SVal V = StateMgr.GetLValue(St, VD);
- if (VD->getType()->isArrayType()) {
- // C++ standard says array of type T should be implicitly converted to
- // pointer to type T in some cases. Currently we don't do this cast in
- // VisitCast(), because BasicStore is not field sensitive. We shall do
- // this in a transfer function in the future. We represent both lvalue and
- // rvalue of array of type T as the corresponding MemRegionVal of it.
-
- MakeNode(Dst, Ex, Pred, SetSVal(St, Ex, V));
- return;
- }
-
if (asLValue)
MakeNode(Dst, Ex, Pred, SetSVal(St, Ex, V));
else
void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst){
NodeSet S1;
QualType T = CastE->getType();
+ QualType ExTy = Ex->getType();
- if (T->isReferenceType())
+ if (ExTy->isArrayType() || T->isReferenceType())
VisitLValue(Ex, Pred, S1);
else
Visit(Ex, Pred, S1);
// let the transfer function object be responsible for constructing
// nodes.
- QualType ExTy = Ex->getType();
-
for (NodeSet::iterator I1 = S1.begin(), E1 = S1.end(); I1 != E1; ++I1) {
NodeTy* N = *I1;
const GRState* St = GetState(N);