Fix PR 4631. The compound initializers of unions were not being evaluated, which
could cause false positives if any the subexpressions had side-effects. These
initializers weren't evaluated because the StoreManager would need to handle
them, but that's an orthogonal problem of whether or not the StoreManager can
handle the binding.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77361 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index eb31f84..ee8865b 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -2228,7 +2228,8 @@
QualType T = getContext().getCanonicalType(E->getType());
unsigned NumInitElements = E->getNumInits();
- if (T->isArrayType() || T->isStructureType()) {
+ if (T->isArrayType() || T->isStructureType() ||
+ T->isUnionType() || T->isVectorType()) {
llvm::ImmutableList<SVal> StartVals = getBasicVals().getEmptySValList();
@@ -2283,13 +2284,6 @@
return;
}
- if (T->isUnionType() || T->isVectorType()) {
- // FIXME: to be implemented.
- // Note: That vectors can return true for T->isIntegerType()
- MakeNode(Dst, E, Pred, state);
- return;
- }
-
if (Loc::IsLocType(T) || T->isIntegerType()) {
assert (E->getNumInits() == 1);
NodeSet Tmp;