]> granicus.if.org Git - clang/commitdiff
ExplodedGraph::shouldCollectNode() should not collect nodes for non-Expr Stmts
authorTed Kremenek <kremenek@apple.com>
Fri, 7 Sep 2012 06:56:18 +0000 (06:56 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 7 Sep 2012 06:56:18 +0000 (06:56 +0000)
(as this previously was the case before this was refactored).  We also shouldn't
need to specially handle BinaryOperators since the eagerly-assume heuristic tags
such nodes.

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

lib/StaticAnalyzer/Core/ExplodedGraph.cpp

index ae746f6325051b5be5f02973b7e46dd05523fc18..ff296403a8c01bfe54ae9e461acbb978870d9413 100644 (file)
@@ -94,9 +94,6 @@ bool ExplodedGraph::shouldCollect(const ExplodedNode *node) {
   PostStmt ps = cast<PostStmt>(progPoint);
   if (ps.getTag())
     return false;
-  
-  if (isa<BinaryOperator>(ps.getStmt()))
-    return false;
 
   // Conditions 5, 6, and 7.
   ProgramStateRef state = node->getState();
@@ -106,6 +103,9 @@ bool ExplodedGraph::shouldCollect(const ExplodedNode *node) {
     return false;
   
   // Condition 8.
+  if (!isa<Expr>(ps.getStmt()))
+    return false;
+  
   if (const Expr *Ex = dyn_cast<Expr>(ps.getStmt())) {
     ParentMap &PM = progPoint.getLocationContext()->getParentMap();
     if (!PM.isConsumedExpr(Ex))