aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-15 15:47:40 +0000
committerChris Lattner <sabre@nondot.org>2003-09-15 15:47:40 +0000
commitc72b249e9cb2f6c89fe3008bb8d1f49468bf5657 (patch)
treec3ba4783aa13c5247e427cfc99d06e5ed2349b69 /include
parent3a49a6b5b85c4750e26a859ba9fed5984d7be09d (diff)
downloadexternal_llvm-c72b249e9cb2f6c89fe3008bb8d1f49468bf5657.zip
external_llvm-c72b249e9cb2f6c89fe3008bb8d1f49468bf5657.tar.gz
external_llvm-c72b249e9cb2f6c89fe3008bb8d1f49468bf5657.tar.bz2
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
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/PostDominators.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h
index f7131f2..8463136 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;
}