mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-25 04:39:44 +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,14 +218,12 @@ 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) {
|
||||
if (Next != ranges.end() && Next->start == I->end && Next->ValId == ValId) {
|
||||
I->end = Next->end;
|
||||
ranges.erase(Next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// extendIntervalStartTo - This method is used when we want to extend the range
|
||||
|
Loading…
Reference in New Issue
Block a user