aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 5867f9b..f4a4b589 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -352,7 +352,7 @@ gfc_copy_shape_excluding (mpz_t * shape, int rank, gfc_expr * dim)
n = mpz_get_si (dim->value.integer);
n--; /* Convert to zero based index */
- if (n < 0 && n >= rank)
+ if (n < 0 || n >= rank)
return NULL;
s = new_shape = gfc_get_shape (rank-1);