aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobi@gcc.gnu.org>2006-05-07 15:46:02 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2006-05-07 15:46:02 +0200
commitd0bd09f613cb8e84c6ee5319b58faa526014b4ef (patch)
treef70b103b3afbabd2c2a76ed7d4ff05e19b60dea1 /gcc/fortran/match.c
parented52affe53af75a099b132ed9957f3df28636f49 (diff)
downloadgcc-d0bd09f613cb8e84c6ee5319b58faa526014b4ef.zip
gcc-d0bd09f613cb8e84c6ee5319b58faa526014b4ef.tar.gz
gcc-d0bd09f613cb8e84c6ee5319b58faa526014b4ef.tar.bz2
re PR fortran/27457 (ICE in match_case_eos())
fortran/ PR fortran/27457 * match.c (match_case_eos): Error out on garbage following CASE(...). testsuite/ PR fortran/27457 * gfortran.dg/select_6.f90: New. From-SVN: r113602
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 865781f..81bbb23 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -3024,6 +3024,11 @@ match_case_eos (void)
if (gfc_match_eos () == MATCH_YES)
return MATCH_YES;
+ /* If the case construct doesn't have a case-construct-name, we
+ should have matched the EOS. */
+ if (!gfc_current_block ())
+ return MATCH_ERROR;
+
gfc_gobble_whitespace ();
m = gfc_match_name (name);