aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CallGraph.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-04-05 04:03:23 +0000
committerTed Kremenek <kremenek@apple.com>2012-04-05 04:03:23 +0000
commitbb3d20f80c98e7919411bc7e062d69b17462899b (patch)
tree856ae293408f43d37f539058862e6f37c5f17b97 /lib/Analysis/CallGraph.cpp
parent6b77ce8824cf62c2cfb61cf2d801eb3fcfbecffe (diff)
Do not crash in the callgraph construction when encountering deleted function definitions. Fixes <rdar://problem/11178609>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154081 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CallGraph.cpp')
-rw-r--r--lib/Analysis/CallGraph.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/CallGraph.cpp b/lib/Analysis/CallGraph.cpp
index eb3f3ef97a..01d6c41f91 100644
--- a/lib/Analysis/CallGraph.cpp
+++ b/lib/Analysis/CallGraph.cpp
@@ -125,7 +125,8 @@ void CallGraph::addToCallGraph(Decl* D, bool IsGlobal) {
// Process all the calls by this function as well.
CGBuilder builder(this, D, Node);
- builder.Visit(D->getBody());
+ if (Stmt *Body = D->getBody())
+ builder.Visit(Body);
}
void CallGraph::addToCallGraph(TranslationUnitDecl *TU) {