Commit 9b0588e9 by Mikael Morin

re PR fortran/69497 (ICE in gfc_free_namespace, at fortran/symbol.c:3701)


	PR fortran/69497
	* symbol.c (gfc_symbol_done_2): Start freeing namespaces
	from the root.
	(gfc_free_namespace): Restore assert (revert r258839).

From-SVN: r258935
parent e8b8462d
2018-03-28 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/69497
* symbol.c (gfc_symbol_done_2): Start freeing namespaces
from the root.
(gfc_free_namespace): Restore assert (revert r258839).
2018-03-28 Jakub Jelinek <jakub@redhat.com>
* gfortran.h (gfc_dt): Rename default_exp field to dec_ext.
......
......@@ -4037,10 +4037,11 @@ gfc_free_namespace (gfc_namespace *ns)
return;
ns->refs--;
if (ns->refs != 0)
if (ns->refs > 0)
return;
gcc_assert (ns->refs == 0);
gfc_free_statements (ns->code);
free_sym_tree (ns->sym_root);
......@@ -4087,8 +4088,14 @@ gfc_symbol_init_2 (void)
void
gfc_symbol_done_2 (void)
{
gfc_free_namespace (gfc_current_ns);
gfc_current_ns = NULL;
if (gfc_current_ns != NULL)
{
/* free everything from the root. */
while (gfc_current_ns->parent != NULL)
gfc_current_ns = gfc_current_ns->parent;
gfc_free_namespace (gfc_current_ns);
gfc_current_ns = NULL;
}
gfc_free_dt_list ();
enforce_single_undo_checkpoint ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment