From 1505f3b58e776fb2865ae9b41d492f3d6b5504a7 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Thu, 24 May 2007 05:03:51 +0000 Subject: [PATCH] re PR fortran/31716 (segfault with real array bounds) 2007-05-23 Jerry DeLisle PR fortran/31716 * array.c (spec_dimen_size): Test for correct BT_INTEGER type. From-SVN: r125013 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/array.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a53691c..f0275ef 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2007-05-23 Jerry DeLisle + + PR fortran/31716 + * array.c (spec_dimen_size): Test for correct BT_INTEGER type. + 2007-05-23 Francois-Xavier Coudert PR fortran/32046 diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 9359624..2a88cc8 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -1725,7 +1725,9 @@ spec_dimen_size (gfc_array_spec *as, int dimen, mpz_t *result) if (as->type != AS_EXPLICIT || as->lower[dimen]->expr_type != EXPR_CONSTANT - || as->upper[dimen]->expr_type != EXPR_CONSTANT) + || as->upper[dimen]->expr_type != EXPR_CONSTANT + || as->lower[dimen]->ts.type != BT_INTEGER + || as->upper[dimen]->ts.type != BT_INTEGER) return FAILURE; mpz_init (*result); -- 2.7.4