diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2015-10-26 17:39:07 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2015-10-26 17:39:07 +0000 |
commit | 15c918bc7645580d6e48fdcab77fc6a2a3347daf (patch) | |
tree | c99ee7a2d7b43c2b17dd0633706b17ebae54e920 /gcc/fortran/array.c | |
parent | f6c1575958f7bf97c543943f18e7461cb17e43d5 (diff) | |
download | gcc-15c918bc7645580d6e48fdcab77fc6a2a3347daf.zip gcc-15c918bc7645580d6e48fdcab77fc6a2a3347daf.tar.gz gcc-15c918bc7645580d6e48fdcab77fc6a2a3347daf.tar.bz2 |
re PR fortran/36192 (ICE with wrong index types and bad parens)
2015-10-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/36192
* array.c (gfc_ref_dimen_size): Check for BT_INTEGER before calling
mpz_set.
2015-10-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/36192
* gfortran.dg/pr36192.f90: New test.
From-SVN: r229387
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r-- | gcc/fortran/array.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 2355a98..940eeaf 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -2208,7 +2208,8 @@ gfc_ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result, mpz_t *end) if (ar->start[dimen] == NULL) { if (ar->as->lower[dimen] == NULL - || ar->as->lower[dimen]->expr_type != EXPR_CONSTANT) + || ar->as->lower[dimen]->expr_type != EXPR_CONSTANT + || ar->as->lower[dimen]->ts.type != BT_INTEGER) goto cleanup; mpz_set (lower, ar->as->lower[dimen]->value.integer); } @@ -2222,7 +2223,8 @@ gfc_ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result, mpz_t *end) if (ar->end[dimen] == NULL) { if (ar->as->upper[dimen] == NULL - || ar->as->upper[dimen]->expr_type != EXPR_CONSTANT) + || ar->as->upper[dimen]->expr_type != EXPR_CONSTANT + || ar->as->upper[dimen]->ts.type != BT_INTEGER) goto cleanup; mpz_set (upper, ar->as->upper[dimen]->value.integer); } |