Hi Andre,
On 9/16/20 9:58 AM, Andre Vehreschild wrote:
+ st->n.sym = NULL;
Don't we need free or unlink the st node from the symtree, too?
I did not see a way to simply remove a single symtree; as this
is the error case, I left the item in the symtree.
The symtree itself is removed when the 'contains' is
processed by calling:
gfc_free_namespace (...)
which calls
free_sym_tree (ns->sym_root)
and that function is:
if (sym_tree == NULL)
return;
free_sym_tree (sym_tree->left);
free_sym_tree (sym_tree->right);
gfc_release_symbol (sym_tree->n.sym);
free (sym_tree);
This "gfc_release_symbol" was actually the call which
handled our "bp" symbol – deleting n.sym->formal.
The parent namespace was still present and called
resolve_formal – which den caused the ICE as its
n.sym->formal was before deleted in "our" namespace.
Tobias
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander
Walter