[llvm-commits] [llvm] r108264 - /llvm/trunk/lib/CodeGen/LiveInterval.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue Jul 13 12:56:28 PDT 2010
Author: stoklund
Date: Tue Jul 13 14:56:28 2010
New Revision: 108264
URL: http://llvm.org/viewvc/llvm-project?rev=108264&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/LiveInterval.cpp
Modified: llvm/trunk/lib/CodeGen/LiveInterval.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveInterval.cpp?rev=108264&r1=108263&r2=108264&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveInterval.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveInterval.cpp Tue Jul 13 14:56:28 2010
@@ -119,6 +119,7 @@
//
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;
More information about the llvm-commits
mailing list