diff options
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 645cb59..8c6e460 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1,5 +1,5 @@ /* YACC parser for C expressions, for GDB. - Copyright (C) 1986-2024 Free Software Foundation, Inc. + Copyright (C) 1986-2025 Free Software Foundation, Inc. This file is part of GDB. @@ -3042,15 +3042,11 @@ classify_name (struct parser_state *par_state, const struct block *block, std::string copy = copy_name (yylval.sval); - /* Initialize this in case we *don't* use it in this call; that way - we can refer to it unconditionally below. */ - memset (&is_a_field_of_this, 0, sizeof (is_a_field_of_this)); - bsym = lookup_symbol (copy.c_str (), block, SEARCH_VFT, par_state->language ()->name_of_this () ? &is_a_field_of_this : NULL); - if (bsym.symbol && bsym.symbol->aclass () == LOC_BLOCK) + if (bsym.symbol && bsym.symbol->loc_class () == LOC_BLOCK) { yylval.ssym.sym = bsym; yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL; @@ -3098,7 +3094,7 @@ classify_name (struct parser_state *par_state, const struct block *block, } } - if (bsym.symbol && bsym.symbol->aclass () == LOC_TYPEDEF) + if (bsym.symbol && bsym.symbol->loc_class () == LOC_TYPEDEF) { yylval.tsym.type = bsym.symbol->type (); return TYPENAME; @@ -3193,7 +3189,7 @@ classify_inner_name (struct parser_state *par_state, return ERROR; } - switch (yylval.ssym.sym.symbol->aclass ()) + switch (yylval.ssym.sym.symbol->loc_class ()) { case LOC_BLOCK: case LOC_LABEL: @@ -3396,18 +3392,18 @@ c_parse (struct parser_state *par_state) c_parse_state cstate; scoped_restore cstate_restore = make_scoped_restore (&cpstate, &cstate); - gdb::unique_xmalloc_ptr<struct macro_scope> macro_scope; + macro_scope macro_scope; if (par_state->expression_context_block) macro_scope = sal_macro_scope (find_pc_line (par_state->expression_context_pc, 0)); else macro_scope = default_macro_scope (); - if (! macro_scope) + if (!macro_scope.is_valid ()) macro_scope = user_macro_scope (); scoped_restore restore_macro_scope - = make_scoped_restore (&expression_macro_scope, macro_scope.get ()); + = make_scoped_restore (&expression_macro_scope, ¯o_scope); scoped_restore restore_yydebug = make_scoped_restore (&yydebug, par_state->debug); |