]> granicus.if.org Git - clang/commitdiff
Fixed logic bug in recursion to visiting child statements.
authorTed Kremenek <kremenek@apple.com>
Wed, 12 Sep 2007 20:08:31 +0000 (20:08 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 12 Sep 2007 20:08:31 +0000 (20:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41887 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/DataflowStmtVisitor.h

index 67c4a75c73acca186e8a140f5715a15eb2b1c396..2f565520900ac549c92f1e403667eff3b5f5bf79 100644 (file)
@@ -56,8 +56,8 @@ public:
 
   void BlockStmt_Visit(Stmt* S, dataflow::forward_analysis_tag) {      
     // Process statements in a postorder traversal of the AST. 
-    if (!CFG::hasImplicitControlFlow(S) &&
-        S->getStmtClass() != Stmt::CallExprClass)
+    if (!CFG::hasImplicitControlFlow(S) ||
+        S->getStmtClass() == Stmt::CallExprClass)
       static_cast<ImplClass*>(this)->VisitChildren(S);
       
     static_cast<ImplClass*>(this)->ObserveBlockStmt(S);
@@ -69,8 +69,8 @@ public:
     static_cast<ImplClass*>(this)->ObserveBlockStmt(S);
     static_cast<CFGStmtVisitor<ImplClass,void>*>(this)->BlockStmt_Visit(S);
     
-    if (!CFG::hasImplicitControlFlow(S) &&
-        S->getStmtClass() != Stmt::CallExprClass)
+    if (!CFG::hasImplicitControlFlow(S) ||
+        S->getStmtClass() == Stmt::CallExprClass)
       static_cast<ImplClass*>(this)->VisitChildren(S);
   }