aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2013-04-14 17:50:57 +0000
committerMikael Morin <mikael@gcc.gnu.org>2013-04-14 17:50:57 +0000
commita5e5226441e3bf95c0e0a4f4db6d687c9215229c (patch)
treef79fa561f34bf163d5d9ac1cc2e2778225bb390e /gcc/fortran/parse.c
parent01007ae0449a8740bbba4a1bda75cdddfe974ef6 (diff)
downloadgcc-a5e5226441e3bf95c0e0a4f4db6d687c9215229c.zip
gcc-a5e5226441e3bf95c0e0a4f4db6d687c9215229c.tar.gz
gcc-a5e5226441e3bf95c0e0a4f4db6d687c9215229c.tar.bz2
re PR fortran/56816 (ICE in delete_root)
fortran/ PR fortran/56816 * match.c (gfc_match_select_type): Add syntax error. Move namespace allocation and cleanup... * parse.c (decode_statement): ... here. testsuite/ PR fortran/56816 * gfortran.dg/select_type_33.f03: New test. From-SVN: r197950
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 6dde0c6..74a5b4b 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -262,6 +262,7 @@ end_of_block:
static gfc_statement
decode_statement (void)
{
+ gfc_namespace *ns;
gfc_statement st;
locus old_locus;
match m;
@@ -363,7 +364,12 @@ decode_statement (void)
match (NULL, gfc_match_associate, ST_ASSOCIATE);
match (NULL, gfc_match_critical, ST_CRITICAL);
match (NULL, gfc_match_select, ST_SELECT_CASE);
+
+ gfc_current_ns = gfc_build_block_ns (gfc_current_ns);
match (NULL, gfc_match_select_type, ST_SELECT_TYPE);
+ ns = gfc_current_ns;
+ gfc_current_ns = gfc_current_ns->parent;
+ gfc_free_namespace (ns);
/* General statement matching: Instead of testing every possible
statement, we eliminate most possibilities by peeking at the