trans-expr.c (get_proc_ptr_comp): Restore initial expression type before calling...
authorMikael Morin <mikael@gcc.gnu.org>
Wed, 6 Oct 2010 16:11:23 +0000 (16:11 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Wed, 6 Oct 2010 16:11:23 +0000 (16:11 +0000)
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.

From-SVN: r165048

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

index dc0bfbb1e38a3aee73418a72f8f6e3436d5a2c81..4f8a609278f5e24350554622600611930ee98ea8 100644 (file)
@@ -1,3 +1,7 @@
+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
index 12ebe4ab54b0be70597152b1595282ae220dc720..1a4828addb61b951c468d19fe5edb46316a772dc 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);