LONGEST len = VEC_length (type_ptr, type_list);
write_exp_elt_opcode (pstate, TYPE_INSTANCE);
+ /* Save the const/volatile qualifiers as
+ recorded by the const_or_volatile
+ production's actions. */
+ write_exp_elt_longcst (pstate,
+ follow_type_instance_flags ());
write_exp_elt_longcst (pstate, len);
for (i = 0;
VEC_iterate (type_ptr, type_list, i, type_elt);
function_method_void: exp '(' ')' const_or_volatile
{ write_exp_elt_opcode (pstate, TYPE_INSTANCE);
+ /* See above. */
+ write_exp_elt_longcst (pstate,
+ follow_type_instance_flags ());
write_exp_elt_longcst (pstate, 0);
write_exp_elt_longcst (pstate, 0);
write_exp_elt_opcode (pstate, TYPE_INSTANCE);
if (len >= 2 && p[len - 2] == 'd' && p[len - 1] == 'f')
{
- p[len - 2] = '\0';
putithere->typed_val_decfloat.type
= parse_type (par_state)->builtin_decfloat;
decimal_from_string (putithere->typed_val_decfloat.val, 4,
gdbarch_byte_order (parse_gdbarch (par_state)),
- p);
- p[len - 2] = 'd';
+ std::string (p, len - 2));
return DECFLOAT;
}
if (len >= 2 && p[len - 2] == 'd' && p[len - 1] == 'd')
{
- p[len - 2] = '\0';
putithere->typed_val_decfloat.type
= parse_type (par_state)->builtin_decdouble;
decimal_from_string (putithere->typed_val_decfloat.val, 8,
gdbarch_byte_order (parse_gdbarch (par_state)),
- p);
- p[len - 2] = 'd';
+ std::string (p, len - 2));
return DECFLOAT;
}
if (len >= 2 && p[len - 2] == 'd' && p[len - 1] == 'l')
{
- p[len - 2] = '\0';
putithere->typed_val_decfloat.type
= parse_type (par_state)->builtin_declong;
decimal_from_string (putithere->typed_val_decfloat.val, 16,
gdbarch_byte_order (parse_gdbarch (par_state)),
- p);
- p[len - 2] = 'd';
+ std::string (p, len - 2));
return DECFLOAT;
}
struct cleanup *back_to;
/* Setting up the parser state. */
+ scoped_restore pstate_restore = make_scoped_restore (&pstate);
gdb_assert (par_state != NULL);
pstate = par_state;
assuming they'll be run here (below). */
back_to = make_cleanup (free_current_contents, &expression_macro_scope);
- make_cleanup_clear_parser_state (&pstate);
/* Set up the scope for macro expansion. */
expression_macro_scope = NULL;