aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index ebc88ea..6829d17 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -6483,7 +6483,7 @@ cleanup:
/* If we are missing an END BLOCK, we created a half-ready namespace.
Remove it from the parent namespace's sibling list. */
- if (state == COMP_BLOCK)
+ while (state == COMP_BLOCK)
{
parent_ns = gfc_current_ns->parent;
@@ -6506,6 +6506,8 @@ cleanup:
gfc_free_namespace (gfc_current_ns);
gfc_current_ns = parent_ns;
+ gfc_state_stack = gfc_state_stack->previous;
+ state = gfc_current_state ();
}
return MATCH_ERROR;