aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r--gcc/fortran/array.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index b958e89..b972abe 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -2213,7 +2213,11 @@ spec_dimen_size (gfc_array_spec *as, int dimen, mpz_t *result)
gfc_internal_error ("spec_dimen_size(): Bad dimension");
if (as->type != AS_EXPLICIT
- || as->lower[dimen]->expr_type != EXPR_CONSTANT
+ || !as->lower[dimen]
+ || !as->upper[dimen])
+ return false;
+
+ if (as->lower[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)