[LLVMdev] RegAllocSimple.cpp
Chris Lattner
sabre at nondot.org
Tue May 2 18:19:02 PDT 2006
On Tue, 2 May 2006, Bill Wendling wrote:
> I saw this potential memory leak in RegAllocSimple.cpp. The
> PhysRegsEverUsed was being allocated but never freed.
The ownership of this array is actally passed over to MachineFunction on
this line:
Fn.setUsedPhysRegs(PhysRegsEverUsed);
It is up to MachineFunction to free it when the code generator is done.
-Chris
> Index: RegAllocSimple.cpp
> ===================================================================
> RCS file: /var/cvs/llvm/llvm/lib/CodeGen/RegAllocSimple.cpp,v
> retrieving revision 1.66
> diff -a -u -r1.66 RegAllocSimple.cpp
> --- RegAllocSimple.cpp 22 Jan 2006 23:39:54 -0000 1.66
> +++ RegAllocSimple.cpp 3 May 2006 01:14:57 -0000
> @@ -240,6 +240,7 @@
> AllocateBasicBlock(*MBB);
>
> StackSlotForVirtReg.clear();
> + delete [] PhysRegsEverUsed;
> return true;
> }
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
More information about the llvm-dev
mailing list