diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-18 19:34:16 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-18 19:34:16 +0000 |
commit | eaa9edac11531178b14e060a32d0ac8b805021d0 (patch) | |
tree | 5a1bb541e52bf2ba895b3a23bdf0d241e7f4a87c | |
parent | cb61292aeafc1dc1bc4064fb3d2733717d1d50e5 (diff) |
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
-rw-r--r-- | include/clang/Analysis/PathSensitive/GRCoreEngine.h | 4 | ||||
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 3 |
2 files changed, 6 insertions, 1 deletions
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<StateTy> **B, GRAuditor<StateTy> **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. |