Patchwork [fortran,19/22] Various minor fixups

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

Comments

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

	* trans-stmt.c (gfc_trans_forall_1): Free forall struct at the end.

Patch

diff --git a/trans-stmt.c b/trans-stmt.c
index 82cddd7..a158c84 100644
--- a/trans-stmt.c
+++ b/trans-stmt.c
@@ -3462,6 +3462,13 @@  gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info)
   gfc_free (varexpr);
   gfc_free (saved_vars);
 
+  for (this_forall = info->this_loop; this_forall;)
+    {
+      iter_info *next = this_forall->next;
+      gfc_free (this_forall);
+      this_forall = next;
+    }
+
   /* Free the space for this forall_info.  */
   gfc_free (info);