]> granicus.if.org Git - clang/commitdiff
We should only scan for nested blocks if we are analyzing the body of a function...
authorTed Kremenek <kremenek@apple.com>
Sat, 12 Dec 2009 01:04:14 +0000 (01:04 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 12 Dec 2009 01:04:14 +0000 (01:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91196 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/AnalysisConsumer.cpp

index dab64d0d93a7c45735b6e642e9117801eaa3d999..5134fa5764ea8d4f0780598a5825665102949885 100644 (file)
@@ -302,7 +302,7 @@ void AnalysisConsumer::HandleCode(Decl *D, Stmt* Body, Actions& actions) {
   llvm::SmallVector<Decl*, 10> WL;
   WL.push_back(D);
   
-  if (Opts.AnalyzeNestedBlocks)
+  if (Body && Opts.AnalyzeNestedBlocks)
     FindBlocks(cast<DeclContext>(D), WL);
   
   for (Actions::iterator I = actions.begin(), E = actions.end(); I != E; ++I)