2010-10-06 Mikael Morin <mikael@gcc.gnu.org>
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Oct 2010 15:39:15 +0000 (15:39 +0000)
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Oct 2010 15:39:15 +0000 (15:39 +0000)
* trans-array.c (gfc_build_constant_array_constructor): Free array
spec when done.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165041 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/trans-array.c

index 7d2f798..27ed63c 100644 (file)
@@ -1,5 +1,10 @@
 2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>
 
+       * trans-array.c (gfc_build_constant_array_constructor): Free array
+       spec when done.
+
+2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>
+
        * symbol.c (gfc_copy_formal_args_ppc): Free previous formal arg list
        before overwriting it.
 
index b32c3ec..93d9b79 100644 (file)
@@ -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;