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 | 78a5bd5dbd4d99d916c69d89ceaabd83c0e52469 (patch) | |
tree | 828a04cf701af281f14123516d706f6fb1345c2e /lib/CodeGen/PrologEpilogInserter.cpp | |
parent | 9f16bcb59f72b95398ff8990a55e8a2f8d5b4bfc (diff) |
Fix PR3845: Avoid stale MachineInstruction pointer reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67649 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PrologEpilogInserter.cpp')
-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 322c28bd4d..564f9a4944 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 |