[cfe-commits] r41887 - /cfe/trunk/include/clang/Analysis/DataflowStmtVisitor.h

Ted Kremenek kremenek at apple.com
Wed Sep 12 13:08:33 PDT 2007


Author: kremenek
Date: Wed Sep 12 15:08:31 2007
New Revision: 41887

URL: http://llvm.org/viewvc/llvm-project?rev=41887&view=rev
Log:
Fixed logic bug in recursion to visiting child statements.

Modified:
    cfe/trunk/include/clang/Analysis/DataflowStmtVisitor.h

Modified: cfe/trunk/include/clang/Analysis/DataflowStmtVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/DataflowStmtVisitor.h?rev=41887&r1=41886&r2=41887&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/DataflowStmtVisitor.h (original)
+++ cfe/trunk/include/clang/Analysis/DataflowStmtVisitor.h Wed Sep 12 15:08:31 2007
@@ -56,8 +56,8 @@
 
   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 @@
     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);
   }
   





More information about the cfe-commits mailing list