aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2011-08-25 19:10:06 +0000
committerMikael Morin <mikael@gcc.gnu.org>2011-08-25 19:10:06 +0000
commitd54e80ce32abdfdbfbc8cd2265091a4187c3efed (patch)
treebe3ae41029778855998bde1d67e542a10f66ae45 /gcc/fortran/expr.c
parent42aa5124f7a7173d1972668378a9531949f92599 (diff)
downloadgcc-d54e80ce32abdfdbfbc8cd2265091a4187c3efed.zip
gcc-d54e80ce32abdfdbfbc8cd2265091a4187c3efed.tar.gz
gcc-d54e80ce32abdfdbfbc8cd2265091a4187c3efed.tar.bz2
re PR fortran/50050 (Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2)
2011-08-25 Mikael Morin <mikael.morin@gcc.gnu.org> PR fortran/50050 * expr.c (gfc_free_shape): Do nothing if shape is NULL. (free_expr0): Remove redundant NULL shape check. * resolve.c (check_host_association): Ditto. * trans-expr.c (gfc_trans_subarray_assign): Assert that shape is non-NULL. * trans-io.c (transfer_array_component): Ditto. 2011-08-25 Mikael Morin <mikael.morin@gcc.gnu.org> PR fortran/50050 * gfortran.dg/pointer_comp_init_1.f90: New test. From-SVN: r178086
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index b050b11..3c09a2a 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -409,6 +409,9 @@ gfc_clear_shape (mpz_t *shape, int rank)
void
gfc_free_shape (mpz_t **shape, int rank)
{
+ if (*shape == NULL)
+ return;
+
gfc_clear_shape (*shape, rank);
free (*shape);
*shape = NULL;
@@ -490,8 +493,7 @@ free_expr0 (gfc_expr *e)
}
/* Free a shape array. */
- if (e->shape != NULL)
- gfc_free_shape (&e->shape, e->rank);
+ gfc_free_shape (&e->shape, e->rank);
gfc_free_ref_list (e->ref);