summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-07-13 19:56:28 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-07-13 19:56:28 +0000
commitfc4b8b8e801cb8dd065919af58c46d3a230d2e0b (patch)
tree5e103d5ba3b80b196765752aa4cd623f6e03bdea /llvm/lib/CodeGen/LiveInterval.cpp
parent58cd65f2febc4bef943b191ae756121bbaf1cd6e (diff)
downloadbcm5719-llvm-fc4b8b8e801cb8dd065919af58c46d3a230d2e0b.tar.gz
bcm5719-llvm-fc4b8b8e801cb8dd065919af58c46d3a230d2e0b.zip
Add an assertion to make PR7542 fail consistently.
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. llvm-svn: 108264
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveInterval.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp
index 9b057b0fec2..1b8509b9a15 100644
--- a/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/llvm/lib/CodeGen/LiveInterval.cpp
@@ -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;
OpenPOWER on IntegriCloud