Do not segfault when the post-dominator tree is empty (ie, there are no return

or unwind instructions in the function)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8537 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-09-15 15:47:40 +00:00
parent 3a49a6b5b8
commit c72b249e9c

View File

@ -88,7 +88,8 @@ struct PostDominanceFrontier : public DominanceFrontierBase {
Frontiers.clear();
PostDominatorTree &DT = getAnalysis<PostDominatorTree>();
Roots = DT.getRoots();
calculate(DT, DT.getRootNode());
if (const DominatorTree::Node *Root = DT.getRootNode())
calculate(DT, Root);
return false;
}