diff options
author | Chris Lattner <sabre@nondot.org> | 2003-09-15 15:47:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-09-15 15:47:40 +0000 |
commit | c72b249e9cb2f6c89fe3008bb8d1f49468bf5657 (patch) | |
tree | c3ba4783aa13c5247e427cfc99d06e5ed2349b69 | |
parent | 3a49a6b5b85c4750e26a859ba9fed5984d7be09d (diff) |
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
-rw-r--r-- | include/llvm/Analysis/PostDominators.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h index f7131f2a45..8463136ea1 100644 --- a/include/llvm/Analysis/PostDominators.h +++ b/include/llvm/Analysis/PostDominators.h @@ -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; } |