From 6c20b88173041e58d5021d47870ba100e14bb51d Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Tue, 5 Apr 2011 20:44:15 +0000 Subject: Add an assertion instead of crashing when the scavenger goes past the end of a basic block. llvm-svn: 128925 --- llvm/lib/CodeGen/RegisterScavenging.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/RegisterScavenging.cpp') diff --git a/llvm/lib/CodeGen/RegisterScavenging.cpp b/llvm/lib/CodeGen/RegisterScavenging.cpp index b9dd28e5c78..ebfe533838d 100644 --- a/llvm/lib/CodeGen/RegisterScavenging.cpp +++ b/llvm/lib/CodeGen/RegisterScavenging.cpp @@ -126,9 +126,10 @@ void RegScavenger::forward() { MBBI = MBB->begin(); Tracking = true; } else { - assert(MBBI != MBB->end() && "Already at the end of the basic block!"); + assert(MBBI != MBB->end() && "Already past the end of the basic block!"); MBBI = llvm::next(MBBI); } + assert(MBBI != MBB->end() && "Already at the end of the basic block!"); MachineInstr *MI = MBBI; -- cgit v1.2.3