Add an assertion to make PR7542 fail consistently.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 13 Jul 2010 19:56:28 +0000 (19:56 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 13 Jul 2010 19:56:28 +0000 (19:56 +0000)
LiveInterval::overlapsFrom dereferences end() if it is called on an empty
interval.

It would be reasonable to just return false - an empty interval doesn't overlap
anything, but I want to know who is doing it first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108264 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveInterval.cpp

index 9b057b0fec2502f3e369254e7014a5f3136c94e1..1b8509b9a15a4c62f11e4e73d2befda83a14875e 100644 (file)
@@ -119,6 +119,7 @@ bool LiveInterval::killedInRange(SlotIndex Start, SlotIndex End) const {
 //
 bool LiveInterval::overlapsFrom(const LiveInterval& other,
                                 const_iterator StartPos) const {
+  assert(!empty() && "empty interval");
   const_iterator i = begin();
   const_iterator ie = end();
   const_iterator j = StartPos;