mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Fix bug where we could iterate off the end of a basic block
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fb2cb69dc5
commit
a13f0d3f41
@ -76,8 +76,9 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
|
||||
// into the phi node destination.
|
||||
//
|
||||
MachineBasicBlock::iterator AfterPHIsIt = MBB.begin();
|
||||
if (AfterPHIsIt != MBB.end())
|
||||
while ((*AfterPHIsIt)->getOpcode() == TargetInstrInfo::PHI) ++AfterPHIsIt;
|
||||
while (AfterPHIsIt != MBB.end() &&
|
||||
(*AfterPHIsIt)->getOpcode() == TargetInstrInfo::PHI)
|
||||
++AfterPHIsIt; // Skip over all of the PHI nodes...
|
||||
RegInfo->copyRegToReg(MBB, AfterPHIsIt, DestReg, IncomingReg, RC);
|
||||
|
||||
// Update live variable information if there is any...
|
||||
|
Loading…
x
Reference in New Issue
Block a user