Let StoreManager do different cast on arrays. BasicStore will just keep it intact.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58028 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp
index cdecb19..70631ac 100644
--- a/lib/Analysis/BasicStore.cpp
+++ b/lib/Analysis/BasicStore.cpp
@@ -51,6 +51,8 @@
SVal getLValueIvar(const GRState* St, const ObjCIvarDecl* D, SVal Base);
SVal getLValueField(const GRState* St, SVal Base, const FieldDecl* D);
SVal getLValueElement(const GRState* St, SVal Base, SVal Offset);
+
+ SVal ArrayToPointer(SVal Array) { return Array; }
virtual Store
RemoveDeadBindings(Store store, Stmt* Loc, const LiveVariables& Live,
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index ae474be..4d771fb 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1503,9 +1503,15 @@
MakeNode(Dst, CastE, N, SetSVal(St, CastE, V));
continue;
}
-
+
+ // StoreManager casts array to different values.
+ if (ExTy->isArrayType()) {
+ V = StateMgr.ArrayToPointer(V);
+ MakeNode(Dst, CastE, N, SetSVal(St, CastE, V));
+ continue;
+ }
+
// All other cases.
-
MakeNode(Dst, CastE, N, SetSVal(St, CastE, EvalCast(V, CastE->getType())));
}
}