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

or unwind instructions in the function)

llvm-svn: 8537
This commit is contained in:
Chris Lattner 2003-09-15 15:47:40 +00:00
parent 0fead45c59
commit b12f83e101
1 changed files with 2 additions and 1 deletions

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;
}