diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-06-04 20:33:36 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-06-04 20:33:36 +0000 |
| commit | 91233153bf7893a7c8b1e536579d01be208f6159 (patch) | |
| tree | 1b732a1075dff87faf79e878ecc8f71243dbf824 /llvm | |
| parent | 59ca6a846f9c130ed44010e78bb539b9a2095490 (diff) | |
| download | bcm5719-llvm-91233153bf7893a7c8b1e536579d01be208f6159.tar.gz bcm5719-llvm-91233153bf7893a7c8b1e536579d01be208f6159.zip | |
Forgot to check for if iterator reached the end.
llvm-svn: 37420
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/CodeGen/IfConversion.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp index 57862eb38c5..95a5394f90b 100644 --- a/llvm/lib/CodeGen/IfConversion.cpp +++ b/llvm/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; |

