diff --git a/clang/include/clang/Analysis/PathSensitive/GRCoreEngine.h b/clang/include/clang/Analysis/PathSensitive/GRCoreEngine.h index ccb217ca0aa8..61f73093fc19 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 **B, GRAuditor **E) { ObjCMsgExprAuditBeg = B; diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index 63986fb38a50..2e474fc8e9a3 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.