diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-03-24 20:33:17 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-03-24 20:33:17 +0000 |
commit | 834b8776328d456574642e7cc6657aa57931fc9f (patch) | |
tree | 828a04cf701af281f14123516d706f6fb1345c2e | |
parent | c8f736455e281ba43164a4791c8d5f079ef00e98 (diff) | |
download | external_llvm-834b8776328d456574642e7cc6657aa57931fc9f.zip external_llvm-834b8776328d456574642e7cc6657aa57931fc9f.tar.gz external_llvm-834b8776328d456574642e7cc6657aa57931fc9f.tar.bz2 |
Fix PR3845: Avoid stale MachineInstruction pointer reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67649 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/PrologEpilogInserter.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index 322c28b..564f9a4 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/lib/CodeGen/PrologEpilogInserter.cpp @@ -513,8 +513,6 @@ void PEI::replaceFrameIndices(MachineFunction &Fn) { int SPAdj = 0; // SP offset due to call frame setup / destroy. if (RS) RS->enterBasicBlock(BB); for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ) { - MachineInstr *MI = I; - if (I->getOpcode() == TargetInstrInfo::DECLARE) { // Ignore it. ++I; @@ -545,8 +543,8 @@ void PEI::replaceFrameIndices(MachineFunction &Fn) { continue; } + MachineInstr *MI = I; bool DoIncr = true; - for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) if (MI->getOperand(i).isFI()) { // Some instructions (e.g. inline asm instructions) can have |