[cfe-commits] r49914 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRCoreEngine.h lib/Analysis/GRExprEngine.cpp

Ted Kremenek kremenek at apple.com
Fri Apr 18 12:34:16 PDT 2008


Author: kremenek
Date: Fri Apr 18 14:34:16 2008
New Revision: 49914

URL: http://llvm.org/viewvc/llvm-project?rev=49914&view=rev
Log:
Fixed elusive caching bug that led to false positives.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h
    cfe/trunk/lib/Analysis/GRExprEngine.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h?rev=49914&r1=49913&r2=49914&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h Fri Apr 18 14:34:16 2008
@@ -164,6 +164,8 @@
   Stmt* getStmt() const { return B[Idx]; }
   
   CFGBlock* getBlock() const { return &B; }
+  
+  bool hasGeneratedNode() const { return HasGeneratedNode; }
 };
   
   
@@ -186,6 +188,8 @@
     CleanedState = getLastNode()->getState();
   }
   
+  bool hasGeneratedNode() const { return NB.hasGeneratedNode(); }
+  
   void setObjCMsgExprAuditors(GRAuditor<StateTy> **B,
                               GRAuditor<StateTy> **E) {
     ObjCMsgExprAuditBeg = B;

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=49914&r1=49913&r2=49914&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Fri Apr 18 14:34:16 2008
@@ -187,7 +187,8 @@
   // If no nodes were generated, generate a new node that has all the
   // dead mappings removed.
   
-  if (Dst.size() == 1 && *Dst.begin() == StmtEntryNode)
+  if (Dst.size() == 1 && *Dst.begin() == StmtEntryNode && 
+      !Builder->hasGeneratedNode())
     builder.generateNode(S, GetState(StmtEntryNode), StmtEntryNode);
   
   // NULL out these variables to cleanup.





More information about the cfe-commits mailing list