1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Fix a conditional so we don't access past the end of the range. Thanks to

Andrew for bringing this to my attn.

llvm-svn: 23850
This commit is contained in:
Chris Lattner 2005-10-20 22:50:10 +00:00
parent 0856abb644
commit 04c1fe840d

View File

@ -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);
}
}