re PR fortran/35093 (gfortran.dg/data_constraints_1.f90)

2008-02-05  Tobias Burnus  <burnus@net-b.de>

        PR fortran/35093
        * data.c (gfc_assign_data_value): Only free "size" if
        it has not already been freed.

From-SVN: r132128
This commit is contained in:
Tobias Burnus 2008-02-05 21:40:45 +01:00 committed by Tobias Burnus
parent 6a279e9228
commit da36ba2754
2 changed files with 14 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2008-02-05 Tobias Burnus <burnus@net-b.de>
PR fortran/35093
* data.c (gfc_assign_data_value): Only free "size" if
it has not already been freed.
2008-02-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34945

View File

@ -321,15 +321,17 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index)
else
{
mpz_t size;
if (spec_size (ref->u.ar.as, &size) == SUCCESS
&& mpz_cmp (offset, size) >= 0)
if (spec_size (ref->u.ar.as, &size) == SUCCESS)
{
if (mpz_cmp (offset, size) >= 0)
{
mpz_clear (size);
gfc_error ("Data element above array upper bound at %L",
&lvalue->where);
return FAILURE;
}
mpz_clear (size);
gfc_error ("Data element above array upper bound at %L",
&lvalue->where);
return FAILURE;
}
mpz_clear (size);
}
/* Splay tree containing offset and gfc_constructor. */