OSDN Git Service

2010-10-06 Mikael Morin <mikael@gcc.gnu.org>
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Oct 2010 16:11:23 +0000 (16:11 +0000)
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Oct 2010 16:11:23 +0000 (16:11 +0000)
* trans-expr.c (get_proc_ptr_comp): Restore initial expression type
before calling gfc_free_expr.

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

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

index dc0bfbb..4f8a609 100644 (file)
@@ -1,5 +1,9 @@
 2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>
 
+       * trans-stmt.c (gfc_trans_forall_1): Free forall struct at the end.
+
+2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>
+
        * trans-expr.c (get_proc_ptr_comp): Restore initial expression type
        before calling gfc_free_expr.
 
index 12ebe4a..1a4828a 100644 (file)
@@ -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);