This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

A patch for memory leak


There is a memory leak in regclass. nregs is not a constant across
calls.


-- 
H.J. Lu (hjl@gnu.org)
----
To fix g++.robertl/eb83.C.

Thu Jul 16 17:48:11 1998  H.J. Lu  (hjl@gnu.org)

	* regclass.c (regclass): Call allocate_reg_info first.

--- ../../../import/egcs/gcc/regclass.c	Tue Jul 14 07:26:58 1998
+++ ./regclass.c	Thu Jul 16 15:42:11 1998
@@ -724,6 +724,8 @@ regclass (f, nregs)
   rtx set;
   int pass;
 
+  allocate_reg_info (nregs, FALSE, FALSE);
+
   init_recog ();
 
   costs = (struct costs *) alloca (nregs * sizeof (struct costs));


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]