https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60898
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #14 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The following "fixes" the issue - but it leaks memory. The problem is that one
calls gfc_traverse_symtree with resolve_symbol. One then one fills all symtrees
from ns->sym_root into the vector st_vec. – If one now calls the sym_func(),
one might delete the symbol (gfc_release_symbol), but one later can access the
symbol via the copied symtree.
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -12987,7 +12987,7 @@ resolve_symbol (gfc_symbol *sym)
{
this_symtree = gfc_find_symtree (gfc_current_ns->sym_root,
sym->name);
- gfc_release_symbol (sym);
+ // gfc_release_symbol (sym); // FIXME
symtree->n.sym->refs++;
this_symtree->n.sym = symtree->n.sym;
return;