Skip to content

Commit

Permalink
[MachineCombiner][NFC] Prevent dereferencing past-the-end object in a…
Browse files Browse the repository at this point in the history
…n MRI container

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350896 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Gerolf-Apple committed Jan 10, 2019
1 parent 3c10eaa commit 7ed9683
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/CodeGen/MachineCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ unsigned MachineCombiner::getLatency(MachineInstr *Root, MachineInstr *NewRoot,
// Get the first instruction that uses MO
MachineRegisterInfo::reg_iterator RI = MRI->reg_begin(MO.getReg());
RI++;
if (RI == MRI->reg_end())
continue;
MachineInstr *UseMO = RI->getParent();
unsigned LatencyOp = 0;
if (UseMO && BlockTrace.isDepInTrace(*Root, *UseMO)) {
Expand Down

0 comments on commit 7ed9683

Please sign in to comment.