Don't leak a MachineInstruction from Thumb1InstrInfo::restoreCalleeSavedRegisters.
authorJeffrey Yasskin <jyasskin@google.com>
Mon, 22 Mar 2010 16:13:21 +0000 (16:13 +0000)
committerJeffrey Yasskin <jyasskin@google.com>
Mon, 22 Mar 2010 16:13:21 +0000 (16:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99182 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/Thumb1InstrInfo.cpp

index 29ae631269a144292eb6f686940b22dee536d973..ad98839ce2626e247055b44469fddd694fb4374e 100644 (file)
@@ -200,6 +200,8 @@ restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
   // It's illegal to emit pop instruction without operands.
   if (NumRegs)
     MBB.insert(MI, &*MIB);
+  else
+    MF.DeleteMachineInstr(MIB);
 
   return true;
 }