mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Fix problem in DEBUG code. I could be pointing past the end and
dereferencing it causes an assertion error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11458 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1fda3700be
commit
b929bca027
@ -245,20 +245,20 @@ bool FPS::processBasicBlock(MachineFunction &MF, MachineBasicBlock &BB) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print out all of the instructions expanded to if -debug
|
// Print out all of the instructions expanded to if -debug
|
||||||
DEBUG(if (&*I == PrevMI) {
|
DEBUG(
|
||||||
std::cerr<< "Just deleted pseudo instruction\n";
|
MachineBasicBlock::iterator PrevI(PrevMI);
|
||||||
} else {
|
if (I == PrevI) {
|
||||||
MachineBasicBlock::iterator Start = I;
|
std::cerr<< "Just deleted pseudo instruction\n";
|
||||||
// Rewind to first instruction newly inserted.
|
} else {
|
||||||
while (Start != BB.begin() &&
|
MachineBasicBlock::iterator Start = I;
|
||||||
--Start != MachineBasicBlock::iterator(PrevMI));
|
// Rewind to first instruction newly inserted.
|
||||||
++Start;
|
while (Start != BB.begin() && prior(Start) != PrevI) --Start;
|
||||||
std::cerr << "Inserted instructions:\n\t";
|
std::cerr << "Inserted instructions:\n\t";
|
||||||
Start->print(std::cerr, MF.getTarget());
|
Start->print(std::cerr, MF.getTarget());
|
||||||
while (++Start != I); ++Start;
|
while (++Start != next(I));
|
||||||
}
|
}
|
||||||
dumpStack();
|
dumpStack();
|
||||||
);
|
);
|
||||||
|
|
||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
}
|
||||||
|
@ -245,20 +245,20 @@ bool FPS::processBasicBlock(MachineFunction &MF, MachineBasicBlock &BB) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print out all of the instructions expanded to if -debug
|
// Print out all of the instructions expanded to if -debug
|
||||||
DEBUG(if (&*I == PrevMI) {
|
DEBUG(
|
||||||
std::cerr<< "Just deleted pseudo instruction\n";
|
MachineBasicBlock::iterator PrevI(PrevMI);
|
||||||
} else {
|
if (I == PrevI) {
|
||||||
MachineBasicBlock::iterator Start = I;
|
std::cerr<< "Just deleted pseudo instruction\n";
|
||||||
// Rewind to first instruction newly inserted.
|
} else {
|
||||||
while (Start != BB.begin() &&
|
MachineBasicBlock::iterator Start = I;
|
||||||
--Start != MachineBasicBlock::iterator(PrevMI));
|
// Rewind to first instruction newly inserted.
|
||||||
++Start;
|
while (Start != BB.begin() && prior(Start) != PrevI) --Start;
|
||||||
std::cerr << "Inserted instructions:\n\t";
|
std::cerr << "Inserted instructions:\n\t";
|
||||||
Start->print(std::cerr, MF.getTarget());
|
Start->print(std::cerr, MF.getTarget());
|
||||||
while (++Start != I); ++Start;
|
while (++Start != next(I));
|
||||||
}
|
}
|
||||||
dumpStack();
|
dumpStack();
|
||||||
);
|
);
|
||||||
|
|
||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user