Avoid dereferencing end() in collectInterferingVRegs() when there is no
[oota-llvm.git] / include / llvm / CodeGen / LiveInterval.h
index c21df28cdd02ad65235a4511d073087b86202492..72f1624d0664d0bb4507e3ef3741c843be7f468c 100644 (file)
@@ -250,6 +250,7 @@ namespace llvm {
     /// position is in a hole, this method returns an iterator pointing to the
     /// LiveRange immediately after the hole.
     iterator advanceTo(iterator I, SlotIndex Pos) {
+      assert(I != end());
       if (Pos >= endIndex())
         return end();
       while (I->end <= Pos) ++I;