Fix bug when processing '?' operator: invalidate the old "Uninitialized" value of the block-level expression for ?.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47645 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/GRExprEngine.cpp b/Analysis/GRExprEngine.cpp
index 674454c..c911064 100644
--- a/Analysis/GRExprEngine.cpp
+++ b/Analysis/GRExprEngine.cpp
@@ -40,7 +40,7 @@
return St;
}
- return StateMgr.SetRVal(St, Ex, isBlkExpr, V);
+ return StateMgr.SetRVal(St, Ex, V, isBlkExpr, false);
}
const GRExprEngine::StateTy::BufferTy&
@@ -606,7 +606,9 @@
assert (SE);
X = GetBlkExprRVal(St, SE);
- Nodify(Dst, Ex, Pred, SetBlkExprRVal(St, Ex, X));
+
+ // Make sure that we invalidate the previous binding.
+ Nodify(Dst, Ex, Pred, StateMgr.SetRVal(St, Ex, X, true, true));
}
/// VisitSizeOfAlignOfTypeExpr - Transfer function for sizeof(type).