mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Fix a conditional so we don't access past the end of the range. Thanks to
Andrew for bringing this to my attn. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23850 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
964b6aacb4
commit
cef6010c64
@ -218,12 +218,10 @@ void LiveInterval::extendIntervalEndTo(Ranges::iterator I, unsigned NewEnd) {
|
||||
|
||||
// If the newly formed range now touches the range after it and if they have
|
||||
// the same value number, merge the two ranges into one range.
|
||||
if (I != ranges.end()) {
|
||||
Ranges::iterator Next = next(I);
|
||||
if (Next->start == I->end && Next->ValId == ValId) {
|
||||
I->end = Next->end;
|
||||
ranges.erase(Next);
|
||||
}
|
||||
Ranges::iterator Next = next(I);
|
||||
if (Next != ranges.end() && Next->start == I->end && Next->ValId == ValId) {
|
||||
I->end = Next->end;
|
||||
ranges.erase(Next);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user