Patchwork [fortran,15/22] Various minor fixups

login
register
mail settings
Submitter Mikael Morin
Date Oct. 5, 2010, 10:11 a.m.
Message ID <20101005100948.1836.57965@gimli.local>
Download mbox | patch
Permalink /patch/66797/
State New
Headers show

Comments

Mikael Morin - Oct. 5, 2010, 10:11 a.m.
2010-10-04  Mikael Morin  <mikael@gcc.gnu.org>

	* trans-array.c (gfc_build_constant_array_constructor): Free array
	spec when done.

Patch

diff --git a/trans-array.c b/trans-array.c
index b32c3ec..93d9b79 100644
--- a/trans-array.c
+++ b/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;