From 1c9afa1aeb7de21a66bc4a16534ff2384f8c3b3a Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Tue, 5 Oct 2010 18:48:55 +0000 Subject: Add assert for valid slot indexes. llvm-svn: 115649 --- llvm/lib/CodeGen/LiveInterval.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/CodeGen/LiveInterval.cpp') diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp index e18d7c7858b..0ea8f5978c9 100644 --- a/llvm/lib/CodeGen/LiveInterval.cpp +++ b/llvm/lib/CodeGen/LiveInterval.cpp @@ -40,6 +40,7 @@ struct CompEnd { } LiveInterval::iterator LiveInterval::find(SlotIndex Pos) { + assert(Pos.isValid() && "Cannot search for an invalid index"); return std::upper_bound(begin(), end(), LiveRange(SlotIndex(), Pos, 0), CompEnd()); } -- cgit v1.2.3