diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp index 8be8761b853..4008ea6d638 100644 --- a/lib/Transforms/IPO/PruneEH.cpp +++ b/lib/Transforms/IPO/PruneEH.cpp @@ -48,11 +48,14 @@ bool PruneEH::runOnSCC(const std::vector &SCC) { std::find(SCC.begin(), SCC.end(), SCC[i]) == SCC.end()) { SCCMightThrow = true; break; } else if (Function *F = SCC[i]->getFunction()) - if (!F->isExternal()) + if (F->isExternal()) { + SCCMightThrow = true; break; + } else { for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) if (isa(I->getTerminator())) { // Uses unwind! SCCMightThrow = true; break; } + } bool MadeChange = false;