summaryrefslogtreecommitdiffstats
path: root/clang/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
commit504957f413bcdfc3fea97cf98dcf6145736610f9 (patch)
tree1f0720ffe259b8c99cee52dd3aafe687c8695b7e /clang/lib/Analysis/CallGraph.cpp
parent3d00eecc53b3b06eead0c5372ac38b0706650a18 (diff)
downloadbcm5719-llvm-504957f413bcdfc3fea97cf98dcf6145736610f9.tar.gz
bcm5719-llvm-504957f413bcdfc3fea97cf98dcf6145736610f9.zip
Do not crash in the callgraph construction when encountering deleted function definitions. Fixes <rdar://problem/11178609>.
llvm-svn: 154081
Diffstat (limited to 'clang/lib/Analysis/CallGraph.cpp')
-rw-r--r--clang/lib/Analysis/CallGraph.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Analysis/CallGraph.cpp b/clang/lib/Analysis/CallGraph.cpp
index eb3f3ef97ac..01d6c41f91b 100644
--- a/clang/lib/Analysis/CallGraph.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud