aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/IfConversion.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-06-04 20:33:36 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-06-04 20:33:36 +0000
commit3ec425470ff42da6b4c075cf6a46d4c002106487 (patch)
tree3f48343c23ead8af6b551f9d87c587edbbb40350 /lib/CodeGen/IfConversion.cpp
parent111354ff99c2480246b8eac905c60a30e9c589d3 (diff)
downloadexternal_llvm-3ec425470ff42da6b4c075cf6a46d4c002106487.zip
external_llvm-3ec425470ff42da6b4c075cf6a46d4c002106487.tar.gz
external_llvm-3ec425470ff42da6b4c075cf6a46d4c002106487.tar.bz2
Forgot to check for if iterator reached the end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37420 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IfConversion.cpp')
-rw-r--r--lib/CodeGen/IfConversion.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp
index 57862eb..95a5394 100644
--- a/lib/CodeGen/IfConversion.cpp
+++ b/lib/CodeGen/IfConversion.cpp
@@ -441,8 +441,9 @@ bool IfConverter::AnalyzeBlocks(MachineFunction &MF,
/// isNextBlock - Returns true either if ToBB the next block after BB or
/// that all the intervening blocks are empty.
static bool isNextBlock(MachineBasicBlock *BB, MachineBasicBlock *ToBB) {
+ MachineFunction *MF = BB->getParent();
MachineFunction::iterator I = BB;
- while (++I != MachineFunction::iterator(ToBB))
+ while (++I != MF->end() && I != MachineFunction::iterator(ToBB))
if (!I->empty())
return false;
return true;