diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-06-28 01:18:58 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-06-28 01:18:58 +0000 |
| commit | 040d65920624c671e1df37b44761b1314989b26a (patch) | |
| tree | 5deef38e4d5e5735692c5541990008e54b950acf /llvm/lib/CodeGen/SplitKit.cpp | |
| parent | 16896325a68ee1f5bac9445226104e9bb649f3f1 (diff) | |
| download | llvm-040d65920624c671e1df37b44761b1314989b26a.zip llvm-040d65920624c671e1df37b44761b1314989b26a.tar.gz llvm-040d65920624c671e1df37b44761b1314989b26a.tar.bz2 | |
Fix a bad iterator dereference that Evan uncovered.
llvm-svn: 133978
Diffstat (limited to 'llvm/lib/CodeGen/SplitKit.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SplitKit.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp index 18f315a..55b1114 100644 --- a/llvm/lib/CodeGen/SplitKit.cpp +++ b/llvm/lib/CodeGen/SplitKit.cpp @@ -76,12 +76,14 @@ SlotIndex SplitAnalysis::computeLastSplitPoint(unsigned Num) { return LSP.first; // There may not be a call instruction (?) in which case we ignore LPad. LSP.second = LSP.first; - for (MachineBasicBlock::const_iterator I = FirstTerm, E = MBB->begin(); - I != E; --I) + for (MachineBasicBlock::const_iterator I = MBB->end(), E = MBB->begin(); + I != E;) { + --I; if (I->getDesc().isCall()) { LSP.second = LIS.getInstructionIndex(I); break; } + } } // If CurLI is live into a landing pad successor, move the last split point |
