From 56354d48bb937cbb23736d24d9ca4d7a0fcc97e0 Mon Sep 17 00:00:00 2001 From: Kalle Raiskila Date: Tue, 11 Oct 2011 12:55:18 +0000 Subject: [PATCH] Fix a iterator out of bounds error, that triggers rarely. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141665 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/CellSPU/SPUInstrInfo.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Target/CellSPU/SPUInstrInfo.cpp b/lib/Target/CellSPU/SPUInstrInfo.cpp index 02cf9bfa735..007bc0e02c7 100644 --- a/lib/Target/CellSPU/SPUInstrInfo.cpp +++ b/lib/Target/CellSPU/SPUInstrInfo.cpp @@ -290,6 +290,8 @@ static void removeHBR( MachineBasicBlock &MBB) { if (I->getOpcode() == SPU::HBRA || I->getOpcode() == SPU::HBR_LABEL){ I=MBB.erase(I); + if (I == MBB.end()) + break; } } }