Fix PR3845: Avoid stale MachineInstruction pointer reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67649 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2009-03-24 20:33:17 +00:00
parent 9f16bcb59f
commit 78a5bd5dbd

View File

@ -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