]> granicus.if.org Git - clang/commitdiff
Do not crash in the callgraph construction when encountering deleted function definit...
authorTed Kremenek <kremenek@apple.com>
Thu, 5 Apr 2012 04:03:23 +0000 (04:03 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 5 Apr 2012 04:03:23 +0000 (04:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154081 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CallGraph.cpp
test/Analysis/misc-ps-cxx0x.cpp

index eb3f3ef97acbb38006ad42d65a215384bc570889..01d6c41f91b54239539d27b0f91b7b1b4058b8d8 100644 (file)
@@ -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) {
index 53b6fa29ad6eb390f780800869a52093e263350b..b4dee3122e2ca1001edd389b8193d06d796666b6 100644 (file)
@@ -68,3 +68,8 @@ void test2() {
   *p = 0xDEADBEEF;  // no-warning
 }
 
+// Do not crash on the following when constructing the
+// callgraph.
+struct RDar11178609 {
+  ~RDar11178609() = delete;
+};