From 8c8144b958684513811d76c54e9f14dbada1ac57 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 19 Jul 2004 05:02:09 +0000 Subject: Fix assertion to not dereference end! llvm-svn: 14991 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/RegAllocLinearScan.cpp') diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp index 24508fbbb02..dbed7973fc4 100644 --- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp +++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp @@ -399,8 +399,8 @@ void RA::assignRegOrStackSlotAtInterval(IntervalPtrs::value_type cur) std::vector::iterator addedItEnd = added.end(); for (IntervalPtrs::iterator i = unhandled_.begin(), e =unhandled_.end(); i != e && addedIt != addedItEnd; ++i) { - while ((*i)->start() > (*addedIt)->start() && - addedIt != addedItEnd) { + while (addedIt != addedItEnd && + (*i)->start() > (*addedIt)->start()) { #ifndef NDEBUG // This code only works if addIntervalsForSpills retursn a // sorted interval list. Assert this is the case now. -- cgit v1.2.3