summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-08-16 11:56:42 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-08-16 11:56:42 +0000
commit2c64130c4320b2bb53db71f737faadd0cc493cd3 (patch)
treef3ccc1ac40def79f7fe3b73581d2e79b849a55d8 /llvm/lib
parent195fd9d97011a43718032ae61fc19bac313cabd9 (diff)
downloadbcm5719-llvm-2c64130c4320b2bb53db71f737faadd0cc493cd3.tar.gz
bcm5719-llvm-2c64130c4320b2bb53db71f737faadd0cc493cd3.zip
Fix use after free in Thumb2SizeReduction (PR4707). A MachineInstr was used after erasure.
llvm-svn: 79189
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/Thumb2SizeReduction.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp b/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp
index b3ed8e84f92..e6f45bb5ca9 100644
--- a/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp
+++ b/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp
@@ -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:
OpenPOWER on IntegriCloud