summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/Analysis/PathSensitive/GRCoreEngine.h4
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp3
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/GRCoreEngine.h b/clang/include/clang/Analysis/PathSensitive/GRCoreEngine.h
index ccb217ca0aa..61f73093fc1 100644
--- a/clang/include/clang/Analysis/PathSensitive/GRCoreEngine.h
+++ b/clang/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/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index 63986fb38a5..2e474fc8e9a 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud