1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Dereferencing end() is bad.

llvm-svn: 15402
This commit is contained in:
Chris Lattner 2004-08-01 09:51:42 +00:00
parent 1ca0362e24
commit 786c788d12

View File

@ -96,7 +96,7 @@ static void ReplaceUsesOfBlockWith(MachineBasicBlock *BB,
// If BB falls through into Old, insert an unconditional branch to New.
MachineFunction::iterator BBSucc = BB; ++BBSucc;
if (&*BBSucc == Old)
if (BBSucc != BB->getParent()->end() && &*BBSucc == Old)
TII.insertGoto(*BB, *New);
std::vector<MachineBasicBlock*> Succs(BB->succ_begin(), BB->succ_end());