- sym = lookup_symbol (copy_name ($1),
- expression_context_block,
- VAR_DOMAIN,
- &is_a_field_of_this);
-
- if (sym.symbol)
- {
- if (symbol_read_needs_frame (sym.symbol))
- innermost_block.update (sym);
-
- write_exp_elt_opcode (pstate, OP_VAR_VALUE);
- write_exp_elt_block (pstate, sym.block);
- write_exp_elt_sym (pstate, sym.symbol);
- write_exp_elt_opcode (pstate, OP_VAR_VALUE);
- }
- else
- {
- struct bound_minimal_symbol msymbol;
- char *arg = copy_name ($1);
-
- msymbol =
- lookup_bound_minimal_symbol (arg);
- if (msymbol.minsym != NULL)
- write_exp_msymbol (pstate, msymbol);
- else if (!have_full_symbols () && !have_partial_symbols ())
- error (_("No symbol table is loaded. Use the \"symbol-file\" command."));
- else
- error (_("No symbol \"%s\" in current context."),
- copy_name ($1));
- }
+ std::string name = copy_name ($1);
+ sym
+ = lookup_symbol (name.c_str (),
+ pstate->expression_context_block,
+ VAR_DOMAIN,
+ &is_a_field_of_this);
+
+ pstate->push_symbol (name.c_str (), sym);