This is a cleaner version, removing an unneeded function and
making sure that no memory leaks can occur if callers change.
gcc/fortran/ChangeLog:
PR fortran/119157
* gfortran.h (gfc_pop_undo_symbol): Remove prototype.
* interface.cc (gfc_get_formal_from_actual_arglist): Use
gfc_commit_symbol() instead of gfc_pop_undo_symbol().
* symbol.cc (gfc_pop_undo_symbol): Remove.
void gfc_save_all (gfc_namespace *);
void gfc_enforce_clean_symbol_state (void);
-void gfc_pop_undo_symbol (void);
gfc_gsymbol *gfc_get_gsymbol (const char *, bool bind_c);
gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, const char *);
{
snprintf (name, GFC_MAX_SYMBOL_LEN, "_formal_%d", var_num ++);
gfc_get_symbol (name, gfc_current_ns, &s);
- /* We do not need this in an undo table. */
- gfc_pop_undo_symbol();
if (a->expr->ts.type == BT_PROCEDURE)
{
gfc_symbol *asym = a->expr->symtree->n.sym;
s->declared_at = a->expr->where;
s->attr.intent = INTENT_UNKNOWN;
(*f)->sym = s;
+ gfc_commit_symbol (s);
}
else /* If a->expr is NULL, this is an alternate rerturn. */
(*f)->sym = NULL;
f = &((*f)->next);
}
+
}
gcc_checking_assert (single_undo_checkpoint_p ());
}
-void
-gfc_pop_undo_symbol ()
-{
- latest_undo_chgset->syms.pop();
-}
/* Undoes all the changes made to symbols in the current statement. */