summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--clang/lib/Analysis/CallGraph.cpp3
-rw-r--r--clang/test/Analysis/misc-ps-cxx0x.cpp5
2 files changed, 7 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) {
diff --git a/clang/test/Analysis/misc-ps-cxx0x.cpp b/clang/test/Analysis/misc-ps-cxx0x.cpp
index 53b6fa29ad6..b4dee3122e2 100644
--- a/clang/test/Analysis/misc-ps-cxx0x.cpp
+++ b/clang/test/Analysis/misc-ps-cxx0x.cpp
@@ -68,3 +68,8 @@ void test2() {
*p = 0xDEADBEEF; // no-warning
}
+// Do not crash on the following when constructing the
+// callgraph.
+struct RDar11178609 {
+ ~RDar11178609() = delete;
+};
OpenPOWER on IntegriCloud