diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2015-10-24 16:20:26 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2015-10-24 16:20:26 +0000 |
commit | 8d48826b99b81b7ed96c5db08ec8334a2b0c6557 (patch) | |
tree | fc9895b536072c30abae69ea95b29645078ed28c /gcc/fortran/array.c | |
parent | ae1158c42534a9becfb51585b9b69df8d0d13a10 (diff) | |
download | gcc-8d48826b99b81b7ed96c5db08ec8334a2b0c6557.zip gcc-8d48826b99b81b7ed96c5db08ec8334a2b0c6557.tar.gz gcc-8d48826b99b81b7ed96c5db08ec8334a2b0c6557.tar.bz2 |
re PR fortran/67805 (ICE on array constructor with wrong character specification)
2015-10-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/67805
* array.c (gfc_match_array_constructor): Check for error from type
spec matching.
* decl.c (char_len_param_value): Check for valid of charlen parameter.
Reap dead code dating to 2008.
match.c (gfc_match_type_spec): Special case the keyword use in REAL.
2015-10-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/67805
* gfortran.dg/pr67805.f90: New testcase.
* gfortran.dg/array_constructor_26.f03: Update testcase.
* gfortran.dg/array_constructor_27.f03: Ditto.
* gfortran.dg/char_type_len_2.f90: Ditto.
* gfortran.dg/pr67802.f90: Ditto.
* gfortran.dg/used_before_typed_3.f90: Ditto.
From-SVN: r229287
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r-- | gcc/fortran/array.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 276737b..2355a98 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -1080,7 +1080,8 @@ gfc_match_array_constructor (gfc_expr **result) /* Try to match an optional "type-spec ::" */ gfc_clear_ts (&ts); gfc_new_undo_checkpoint (changed_syms); - if (gfc_match_type_spec (&ts) == MATCH_YES) + m = gfc_match_type_spec (&ts); + if (m == MATCH_YES) { seen_ts = (gfc_match (" ::") == MATCH_YES); @@ -1102,6 +1103,11 @@ gfc_match_array_constructor (gfc_expr **result) } } } + else if (m == MATCH_ERROR) + { + gfc_restore_last_undo_checkpoint (); + goto cleanup; + } if (seen_ts) gfc_drop_last_undo_checkpoint (); |