]> granicus.if.org Git - clang/commitdiff
Fixed subtle bug in the an GRAuditor object could mark a node as a sink
authorTed Kremenek <kremenek@apple.com>
Tue, 6 May 2008 03:26:52 +0000 (03:26 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 6 May 2008 03:26:52 +0000 (03:26 +0000)
after it was already added to the destination NodeSet.

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

include/clang/Analysis/PathSensitive/GRCoreEngine.h

index bef2e2c0b608a1d0d7cf184759fc95b2c91fcd98..aa8ca231b0f3f7c23bda0d7d14616ec369de8b49 100644 (file)
@@ -32,14 +32,14 @@ class GREndPathNodeBuilderImpl;
 class GRWorkList;
 
 //===----------------------------------------------------------------------===//
-/// GRCoreEngineImpl - Implements the core logic of the graph-reachability analysis.
-///   It traverses the CFG and generates the ExplodedGraph. Program "states"
-///   are treated as opaque void pointers.  The template class GRCoreEngine
-///   (which subclasses GRCoreEngineImpl) provides the matching component
-///   to the engine that knows the actual types for states.  Note that this
-///   engine only dispatches to transfer functions as the statement and
-///   block-level.  The analyses themselves must implement any transfer
-///   function logic and the sub-expression level (if any).
+/// GRCoreEngineImpl - Implements the core logic of the graph-reachability 
+///   analysis. It traverses the CFG and generates the ExplodedGraph.
+///   Program "states" are treated as opaque void pointers.
+///   The template class GRCoreEngine (which subclasses GRCoreEngineImpl)
+///   provides the matching component to the engine that knows the actual types
+///   for states.  Note that this engine only dispatches to transfer functions
+///   at the statement and block-level.  The analyses themselves must implement
+///   any transfer function logic and the sub-expression level (if any).
 class GRCoreEngineImpl {
 protected:
   friend class GRStmtNodeBuilderImpl;
@@ -263,11 +263,11 @@ public:
       if (BuildSinks)
         N->markAsSink();
       else {
-        Dst.Add(N);
-        
         for ( ; AB != AE; ++AB)
           if ((*AB)->Audit(N))
-            N->markAsSink();            
+            N->markAsSink();
+        
+        Dst.Add(N);
       }
     }