diff options
author | Hal Finkel <hfinkel@anl.gov> | 2016-05-21 16:03:50 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2016-05-21 16:03:50 +0000 |
commit | 7b1b3daf6e7adee838bcb76621dc6adb1cbadae6 (patch) | |
tree | 9bde74090a89738c7d597db67dd3f1dd45700aac /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | a63a1297499a36f3063bcc36ec07c9d5c531c15f (diff) | |
download | llvm-7b1b3daf6e7adee838bcb76621dc6adb1cbadae6.zip llvm-7b1b3daf6e7adee838bcb76621dc6adb1cbadae6.tar.gz llvm-7b1b3daf6e7adee838bcb76621dc6adb1cbadae6.tar.bz2 |
[LiveIntervalAnalysis] Don't dereference an end iterator in repairIntervalsInRange
This fixes a bug introduced in:
r262115 - CodeGen: Take MachineInstr& in SlotIndexes and LiveIntervals, NFC
The iterator End here might == MBB->end(), and so we can't unconditionally
dereference it. This often goes unnoticed (I don't have a test case that always
crashes, and ASAN does not catch it either) because the function call arguments are
turned right back into iterators. MachineInstrBundleIterator's constructor,
however, does have an assert which might randomly fire.
llvm-svn: 270323
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index a0e6e20..16d0030 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1496,7 +1496,7 @@ LiveIntervals::repairIntervalsInRange(MachineBasicBlock *MBB, else endIdx = getInstructionIndex(*End); - Indexes->repairIndexesInRange(MBB, *Begin, *End); + Indexes->repairIndexesInRange(MBB, Begin, End); for (MachineBasicBlock::iterator I = End; I != Begin;) { --I; |