Fix use after free in Thumb2SizeReduction (PR4707). A MachineInstr was used after erasure.

llvm-svn: 79189
This commit is contained in:
Benjamin Kramer 2009-08-16 11:56:42 +00:00
parent 195fd9d970
commit 2c64130c43
1 changed files with 4 additions and 1 deletions

View File

@ -654,8 +654,11 @@ bool Thumb2SizeReduce::ReduceMBB(MachineBasicBlock &MBB) {
}
// Try to transform ro a 16-bit non-two-address instruction.
if (Entry.NarrowOpc1 && ReduceToNarrow(MBB, MI, Entry, LiveCPSR))
if (Entry.NarrowOpc1 && ReduceToNarrow(MBB, MI, Entry, LiveCPSR)) {
Modified = true;
MachineBasicBlock::iterator I = prior(NextMII);
MI = &*I;
}
}
ProcessNext: