diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-02-22 07:07:59 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-02-22 07:07:59 +0000 |
commit | 0a921698b6d6f8a40df3893a72c7e6ced1c919a0 (patch) | |
tree | 8ef082318999b31a2cb01a0c3bab181298f4c917 /lib/Target/ARM/Thumb2InstrInfo.cpp | |
parent | af05c69ba024b1838ae6f1071d6fd0f9fe33999f (diff) | |
download | llvm-0a921698b6d6f8a40df3893a72c7e6ced1c919a0.tar.gz llvm-0a921698b6d6f8a40df3893a72c7e6ced1c919a0.tar.bz2 llvm-0a921698b6d6f8a40df3893a72c7e6ced1c919a0.tar.xz |
Guard against de-referencing MBB.end().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126192 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Thumb2InstrInfo.cpp')
-rw-r--r-- | lib/Target/ARM/Thumb2InstrInfo.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/ARM/Thumb2InstrInfo.cpp b/lib/Target/ARM/Thumb2InstrInfo.cpp index 836c1baffd..9b1073be3c 100644 --- a/lib/Target/ARM/Thumb2InstrInfo.cpp +++ b/lib/Target/ARM/Thumb2InstrInfo.cpp @@ -95,8 +95,11 @@ Thumb2InstrInfo::ReplaceTailWithBranchTo(MachineBasicBlock::iterator Tail, bool Thumb2InstrInfo::isLegalToSplitMBBAt(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI) const { - while (MBBI->isDebugValue()) + while (MBBI->isDebugValue()) { ++MBBI; + if (MBBI == MBB.end()) + return false; + } unsigned PredReg = 0; return llvm::getITInstrPredicate(MBBI, PredReg) == ARMCC::AL; |