diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2016-07-30 23:01:06 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2016-07-30 23:01:06 +0000 |
commit | 9fcb28197f056fd7e1ace31db7aa7f0104f7eb96 (patch) | |
tree | 54c1c5e532ad18166a3465120bb778aa7e7682a7 /gcc/fortran/check.c | |
parent | 8bada5cd4e51feb60e1e887ecf0bda3288949af4 (diff) | |
download | gcc-9fcb28197f056fd7e1ace31db7aa7f0104f7eb96.zip gcc-9fcb28197f056fd7e1ace31db7aa7f0104f7eb96.tar.gz gcc-9fcb28197f056fd7e1ace31db7aa7f0104f7eb96.tar.bz2 |
re PR fortran/68566 (ICE on using unusable array in reshape (double free or corruption))
2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/68566
* check.c (gfc_check_reshape): Check for constant expression.
2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/68566
* gfortran.dg/pr68566.f90: new test.
From-SVN: r238911
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r-- | gcc/fortran/check.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 085ac40..288957a 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -3827,7 +3827,7 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape, if (!type_check (order, 3, BT_INTEGER)) return false; - if (order->expr_type == EXPR_ARRAY) + if (order->expr_type == EXPR_ARRAY && gfc_is_constant_expr (order)) { int i, order_size, dim, perm[GFC_MAX_DIMENSIONS]; gfc_expr *e; |