]> granicus.if.org Git - clang/commitdiff
[analyzer] Run post-stmt checks for DeclStmt.
authorJordan Rose <jordan_rose@apple.com>
Fri, 13 Sep 2013 00:44:47 +0000 (00:44 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 13 Sep 2013 00:44:47 +0000 (00:44 +0000)
No tests because no in-tree checkers use this, but that shouldn't stop
out-of-tree checkers.

Found by Aemon Cannon!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190650 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/ExprEngineC.cpp

index e28cc86d204c51e74caf24bbdd508d6df77149e4..b2d62ac8de2f21514d21588088638a8be2f45784 100644 (file)
@@ -446,7 +446,8 @@ void ExprEngine::VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred,
   ExplodedNodeSet dstPreVisit;
   getCheckerManager().runCheckersForPreStmt(dstPreVisit, Pred, DS, *this);
   
-  StmtNodeBuilder B(dstPreVisit, Dst, *currBldrCtx);
+  ExplodedNodeSet dstEvaluated;
+  StmtNodeBuilder B(dstPreVisit, dstEvaluated, *currBldrCtx);
   for (ExplodedNodeSet::iterator I = dstPreVisit.begin(), E = dstPreVisit.end();
        I!=E; ++I) {
     ExplodedNode *N = *I;
@@ -499,6 +500,8 @@ void ExprEngine::VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred,
       B.generateNode(DS, N, state);
     }
   }
+
+  getCheckerManager().runCheckersForPostStmt(Dst, B.getResults(), DS, *this);
 }
 
 static ProgramStateRef evaluateLogicalExpression(const Expr *E,