From: Ted Kremenek Date: Fri, 18 Apr 2008 19:34:16 +0000 (+0000) Subject: Fixed elusive caching bug that led to false positives. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eaa9edac11531178b14e060a32d0ac8b805021d0;p=clang Fixed elusive caching bug that led to false positives. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49914 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/PathSensitive/GRCoreEngine.h b/include/clang/Analysis/PathSensitive/GRCoreEngine.h index ccb217ca0a..61f73093fc 100644 --- a/include/clang/Analysis/PathSensitive/GRCoreEngine.h +++ b/include/clang/Analysis/PathSensitive/GRCoreEngine.h @@ -164,6 +164,8 @@ public: Stmt* getStmt() const { return B[Idx]; } CFGBlock* getBlock() const { return &B; } + + bool hasGeneratedNode() const { return HasGeneratedNode; } }; @@ -186,6 +188,8 @@ public: CleanedState = getLastNode()->getState(); } + bool hasGeneratedNode() const { return NB.hasGeneratedNode(); } + void setObjCMsgExprAuditors(GRAuditor **B, GRAuditor **E) { ObjCMsgExprAuditBeg = B; diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 63986fb38a..2e474fc8e9 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -187,7 +187,8 @@ void GRExprEngine::ProcessStmt(Stmt* S, StmtNodeBuilder& builder) { // 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.