@@ -1964,11 +1964,11 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
19641964 case Stmt::CXXDefaultArgExprClass:
19651965 case Stmt::CXXDefaultInitExprClass: {
19661966 Bldr.takeNodes (Pred);
1967- ExplodedNodeSet CheckedSet ;
1968- getCheckerManager ().runCheckersForPreStmt (CheckedSet , Pred, S, *this );
1967+ ExplodedNodeSet PreVisit ;
1968+ getCheckerManager ().runCheckersForPreStmt (PreVisit , Pred, S, *this );
19691969
19701970 ExplodedNodeSet Tmp;
1971- StmtNodeBuilder Bldr2 (CheckedSet , Tmp, *currBldrCtx);
1971+ StmtNodeBuilder Bldr2 (PreVisit , Tmp, *currBldrCtx);
19721972
19731973 bool HasRewrittenInit = false ;
19741974 const Expr *ArgE = nullptr ;
@@ -1982,12 +1982,11 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
19821982 llvm_unreachable (" unknown constant wrapper kind" );
19831983
19841984 if (HasRewrittenInit) {
1985- for (auto *I : CheckedSet) {
1986- ProgramStateRef state = (*I).getState ();
1987- const LocationContext *LCtx = (*I).getLocationContext ();
1988- SVal Val = state->getSVal (ArgE, LCtx);
1989- state = state->BindExpr (S, LCtx, Val);
1990- Bldr2.generateNode (S, I, state);
1985+ for (auto *N : PreVisit) {
1986+ ProgramStateRef state = N->getState ();
1987+ const LocationContext *LCtx = N->getLocationContext ();
1988+ state = state->BindExpr (S, LCtx, state->getSVal (ArgE, LCtx));
1989+ Bldr2.generateNode (S, N, state);
19911990 }
19921991 } else {
19931992 // If it's not rewritten, the contents of these expressions are not
@@ -2000,13 +1999,10 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
20001999 }
20012000
20022001 std::optional<SVal> ConstantVal = svalBuilder.getConstantVal (ArgE);
2003- if (!ConstantVal)
2004- ConstantVal = UnknownVal ();
2005-
20062002 const LocationContext *LCtx = Pred->getLocationContext ();
2007- for (auto *I : CheckedSet ) {
2003+ for (auto *I : PreVisit ) {
20082004 ProgramStateRef State = I->getState ();
2009- State = State->BindExpr (S, LCtx, * ConstantVal);
2005+ State = State->BindExpr (S, LCtx, ConstantVal. value_or ( UnknownVal ()) );
20102006 if (IsTemporary)
20112007 State = createTemporaryRegionIfNeeded (State, LCtx, cast<Expr>(S),
20122008 cast<Expr>(S));
0 commit comments