aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/simplify.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2016-04-09 19:09:02 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2016-04-09 19:09:02 +0000
commita5edb32e6bf15519852b9cc321aa397ed238efef (patch)
tree1ced5448c700f915d81da68df88da1b2b68dd7ff /gcc/fortran/simplify.c
parentc532c87139a9410212ab0eff59a4980d28646bfa (diff)
downloadgcc-a5edb32e6bf15519852b9cc321aa397ed238efef.zip
gcc-a5edb32e6bf15519852b9cc321aa397ed238efef.tar.gz
gcc-a5edb32e6bf15519852b9cc321aa397ed238efef.tar.bz2
re PR fortran/68566 (ICE on using unusable array in reshape (double free or corruption))
2016-04-09 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/68566 * array.c (match_array_element_spec): Add check for non-integer. * simplify.c (gfc_simplify_reshape): If source shape is NULL return. PR fortran/68566 * gfortran.dg/pr36192.f90: Update test. * gfortran.dg/pr36192_1.f90: Update test. * gfortran.dg/real_dimension_1.f: Update test. * gfortran.dg/parameter_array_init_7.f90: New test. From-SVN: r234864
Diffstat (limited to 'gcc/fortran/simplify.c')
-rw-r--r--gcc/fortran/simplify.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 12a8f32..a631010 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -5163,6 +5163,9 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shape_exp,
|| !is_constant_array_expr (order_exp))
return NULL;
+ if (source->shape == NULL)
+ return NULL;
+
/* Proceed with simplification, unpacking the array. */
mpz_init (index);