diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-05-13 18:11:32 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-05-13 18:11:32 +0000 |
commit | ca960c9946094deab036101b755c5bbed1cd9f86 (patch) | |
tree | d83449129b1ea11a7a44aca47cd0ab833334f711 /include/llvm/Transforms | |
parent | c7365a9ec96ff434d93d0d8052812283b33e537d (diff) | |
download | external_llvm-ca960c9946094deab036101b755c5bbed1cd9f86.zip external_llvm-ca960c9946094deab036101b755c5bbed1cd9f86.tar.gz external_llvm-ca960c9946094deab036101b755c5bbed1cd9f86.tar.bz2 |
Fix an infinite loop bug that Vladimir Prus identified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28281 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r-- | include/llvm/Transforms/Utils/BasicBlockUtils.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h index 9fe7e47..4c12c70 100644 --- a/include/llvm/Transforms/Utils/BasicBlockUtils.h +++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h @@ -86,9 +86,10 @@ inline bool SplitCriticalEdge(BasicBlock *Succ, pred_iterator PI, Pass *P = 0) { inline bool SplitCriticalEdge(BasicBlock *Src, BasicBlock *Dst, Pass *P = 0) { TerminatorInst *TI = Src->getTerminator(); - for (unsigned i = 0, e = TI->getNumSuccessors(); ; ++i) + for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) if (TI->getSuccessor(i) == Dst) return SplitCriticalEdge(TI, i, P); + return false; } } // End llvm namespace |