@@ -1237,30 +1237,27 @@ void ExprEngine::VisitAttributedStmt(const AttributedStmt *A,
12371237void ExprEngine::VisitCXXParenListInitExpr (const CXXParenListInitExpr *E,
12381238 ExplodedNode *Pred,
12391239 ExplodedNodeSet &Dst) {
1240- StmtNodeBuilder Bldr (Pred, Dst, *currBldrCtx );
1240+ const LocationContext *LC = Pred-> getLocationContext ( );
12411241
1242+ StmtNodeBuilder Bldr (Pred, Dst, *currBldrCtx);
12421243 ProgramStateRef S = Pred->getState ();
1243- QualType T = getContext ().getCanonicalType (E->getType ());
12441244
1245- const LocationContext *LCtx = Pred->getLocationContext ();
1245+ QualType T = E->getType ().getCanonicalType ();
1246+ ArrayRef<Expr *> Inits = E->getInitExprs ();
12461247
1247- SmallVector<SVal, 4 > ArgVals;
1248- for (Expr *Arg : E->getInitExprs ())
1249- ArgVals.push_back (S->getSVal (Arg, LCtx));
1250-
1251- if (!E->isGLValue () && (T->isRecordType () || T->isArrayType ())) {
1248+ if (Inits.size () > 1 ||
1249+ (E->isPRValue () && (T->isRecordType () || T->isArrayType ()))) {
12521250 llvm::ImmutableList<SVal> ArgList = getBasicVals ().getEmptySValList ();
1253-
1254- for (const SVal &V : llvm::reverse (ArgVals))
1255- ArgList = getBasicVals ().prependSVal (V, ArgList);
1251+ for (Expr *E : llvm::reverse (Inits))
1252+ ArgList = getBasicVals ().prependSVal (S->getSVal (E, LC), ArgList);
12561253
12571254 Bldr.generateNode (
1258- E, Pred, S->BindExpr (E, LCtx , svalBuilder.makeCompoundVal (T, ArgList)));
1255+ E, Pred, S->BindExpr (E, LC , svalBuilder.makeCompoundVal (T, ArgList)));
12591256 } else {
12601257 Bldr.generateNode (E, Pred,
1261- S->BindExpr (E, LCtx ,
1262- ArgVals. empty ()
1258+ S->BindExpr (E, LC ,
1259+ Inits. size () == 0
12631260 ? getSValBuilder ().makeZeroVal (T)
1264- : ArgVals .front ()));
1261+ : S-> getSVal (Inits .front (), LC )));
12651262 }
12661263}
0 commit comments