Add an assertion instead of crashing when the scavenger goes past the end

of a basic block.

llvm-svn: 128925
This commit is contained in:
Bob Wilson 2011-04-05 20:44:15 +00:00
parent 26bf6ca0d3
commit ef86806800

View File

@ -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;