diff options
author | Harald Anlauf <anlauf@gmx.de> | 2017-07-06 19:49:33 +0000 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2017-07-06 21:49:33 +0200 |
commit | 2c6e2eb1b10bb921b739c8733721cc8a0274dccd (patch) | |
tree | 58a20d5f3705f538114c4d6a3c3ea58a6ae5bad8 /gcc/fortran/array.c | |
parent | 9ddfe5f4202736b44f464ffabff0c3fb3f4b1d8b (diff) | |
download | gcc-2c6e2eb1b10bb921b739c8733721cc8a0274dccd.zip gcc-2c6e2eb1b10bb921b739c8733721cc8a0274dccd.tar.gz gcc-2c6e2eb1b10bb921b739c8733721cc8a0274dccd.tar.bz2 |
re PR fortran/70071 (ICE on wrong usage of a subscript triplet)
2017-07-06 Harald Anlauf <anlauf@gmx.de>
PR fortran/70071
* array.c (gfc_ref_dimen_size): Handle bad subscript triplets.
2017-07-06 Harald Anlauf <anlauf@gmx.de>
PR fortran/70071
* gfortran.dg/coarray_44.f90: New testcase.
From-SVN: r250039
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 30656c1..46642bb 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -2203,9 +2203,15 @@ gfc_ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result, mpz_t *end) bool t; gfc_expr *stride_expr = NULL; - if (dimen < 0 || ar == NULL || dimen > ar->dimen - 1) + if (dimen < 0 || ar == NULL) gfc_internal_error ("gfc_ref_dimen_size(): Bad dimension"); + if (dimen > ar->dimen - 1) + { + gfc_error ("Bad array dimension at %L", &ar->c_where[dimen]); + return false; + } + switch (ar->dimen_type[dimen]) { case DIMEN_ELEMENT: |