mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-15 15:48:38 +00:00
Fix bug where we could iterate off the end of a basic block
llvm-svn: 6116
This commit is contained in:
parent
a8497e3094
commit
ce4b5cd9bf
@ -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…
Reference in New Issue
Block a user