[X86]: Fix for uninitialized access introduced in r272797.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272835 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kevin B. Smith 2016-06-15 20:52:19 +00:00
parent efa2e76536
commit f258b9a271

View File

@ -372,12 +372,16 @@ void FixupBWInstPass::processBasicBlock(MachineFunction &MF,
LiveRegs.addLiveIns(MBB);
auto NextCandidateIter = MIReplacements.begin();
auto EndCandidateIter = MIReplacements.end();
for (auto I = MBB.begin(); I != MBB.end(); ++I) {
MachineInstr *MI = &*I;
SmallVector<std::pair<unsigned, const MachineOperand*>, 4> Clobbers;
LiveRegs.stepForward(*MI, Clobbers);
if (NextCandidateIter == EndCandidateIter)
break;
// Only check and create a new instruction if this instruction is
// known to be a candidate that didn't get transformed.
if (NextCandidateIter->first == MI) {