From: Mikael Morin Date: Wed, 6 Oct 2010 15:39:15 +0000 (+0000) Subject: trans-array.c (gfc_build_constant_array_constructor): Free array spec when done. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b4544b729d2d4d159df843afa8252af13fb2e55;p=gcc.git trans-array.c (gfc_build_constant_array_constructor): Free array spec when done. 2010-10-06 Mikael Morin * trans-array.c (gfc_build_constant_array_constructor): Free array spec when done. From-SVN: r165041 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7d2f798da51..27ed63c2706 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2010-10-06 Mikael Morin + + * trans-array.c (gfc_build_constant_array_constructor): Free array + spec when done. + 2010-10-06 Mikael Morin * symbol.c (gfc_copy_formal_args_ppc): Free previous formal arg list diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index b32c3eccd8f..93d9b79f178 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -1731,6 +1731,13 @@ gfc_build_constant_array_constructor (gfc_expr * expr, tree type) tmptype = gfc_get_nodesc_array_type (type, &as, PACKED_STATIC, true); + /* as is not needed anymore. */ + for (i = 0; i < as.rank + as.corank; i++) + { + gfc_free_expr (as.lower[i]); + gfc_free_expr (as.upper[i]); + } + init = build_constructor (tmptype, v); TREE_CONSTANT (init) = 1;