Patchwork [Fortran,committed] Plug another memory leak

login
register
mail settings
Submitter Tobias Burnus
Date Aug. 28, 2012, 5:35 a.m.
Message ID <503C58A7.5030709@net-b.de>
Download mbox | patch
Permalink /patch/180332/
State New
Headers show

Comments

Tobias Burnus - Aug. 28, 2012, 5:35 a.m.
That's probably the last patch of this kind for a while.

By using formal_ns, the namespace is freed when the main symbol is freed.

Committed as Rev.

Tobias

Patch

Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog	(Revision 190737)
+++ gcc/fortran/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,8 @@ 
+2012-08-28  Tobias Burnus  <burnus@net-b.de>
+
+	PR fortran/54384
+	* symbol.c (gfc_copy_formal_args): Set also sym->formal_ns.
+
 2012-08-27  Tobias Burnus  <burnus@net-b.de>
 
 	PR fortran/54384
Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c	(Revision 190737)
+++ gcc/fortran/symbol.c	(Arbeitskopie)
@@ -4103,6 +4103,7 @@ 
      of the formal args).  */
   gfc_current_ns = gfc_get_namespace (parent_ns, 0);
   gfc_current_ns->proc_name = dest;
+  dest->formal_ns = gfc_current_ns;
 
   for (curr_arg = src->formal; curr_arg; curr_arg = curr_arg->next)
     {