diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index 80a6ed290c7..54e460f7b46 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -82,7 +82,9 @@ bool LiveInterval::overlapsFrom(const LiveInterval& other, return true; } - while (i != ie && j != je) { + if (j == je) return false; + + while (i != ie) { if (i->start > j->start) { std::swap(i, j); std::swap(ie, je);