Fixed insidious state propagation bug that would sometimes cause the state
to bifurcate at the wrong places and not propagate at others.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47876 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/GRExprEngine.cpp b/Analysis/GRExprEngine.cpp
index 660ed1b..9513deb 100644
--- a/Analysis/GRExprEngine.cpp
+++ b/Analysis/GRExprEngine.cpp
@@ -437,8 +437,10 @@
GRExprEngine::Nodify(NodeSet& Dst, Stmt* S, NodeTy* Pred, ValueState* St) {
// If the state hasn't changed, don't generate a new node.
- if (St == Pred->getState())
+ if (St == Pred->getState()) {
+ Dst.Add(Pred);
return NULL;
+ }
NodeTy* N = Builder->generateNode(S, St, Pred);
Dst.Add(N);
@@ -478,11 +480,8 @@
if (AI != AE) {
- NodeSet DstTmp;
-
- Visit(*AI, Pred, DstTmp);
-
- if (DstTmp.empty()) DstTmp.Add(Pred);
+ NodeSet DstTmp;
+ Visit(*AI, Pred, DstTmp);
Expr* CurrentArg = *AI;
++AI;