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
This commit is contained in:
Reid Spencer 2006-05-13 18:11:32 +00:00
parent c7365a9ec9
commit ca960c9946

View File

@ -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