llvm.org GIT mirror llvm / c9b98ad
Fix infinite loop in DSE when deleting a free in a reachable loop that's also trivially infinite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146197 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Lewycky 7 years ago
2 changed file(s) with 11 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
623623 BasicBlock *BB, DominatorTree *DT) {
624624 for (pred_iterator I = pred_begin(BB), E = pred_end(BB); I != E; ++I) {
625625 BasicBlock *Pred = *I;
626 if (Pred == BB) continue;
626627 TerminatorInst *PredTI = Pred->getTerminator();
627628 if (PredTI->getNumSuccessors() != 1)
628629 continue;
852853 I != E; ++I)
853854 DeadStackObjects.erase(*I);
854855 }
855
5757 tail call void @free(i8* %alloc1) nounwind
5858 ret void
5959 }
60
61 ; CHECK: @test5
62 define void @test5() {
63 br label %bb
64
65 bb:
66 tail call void @free(i8* undef) nounwind
67 br label %bb
68 }
69