@@ -1964,11 +1964,11 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
1964
1964
case Stmt::CXXDefaultArgExprClass:
1965
1965
case Stmt::CXXDefaultInitExprClass: {
1966
1966
Bldr.takeNodes (Pred);
1967
- ExplodedNodeSet CheckedSet ;
1968
- getCheckerManager ().runCheckersForPreStmt (CheckedSet , Pred, S, *this );
1967
+ ExplodedNodeSet PreVisit ;
1968
+ getCheckerManager ().runCheckersForPreStmt (PreVisit , Pred, S, *this );
1969
1969
1970
1970
ExplodedNodeSet Tmp;
1971
- StmtNodeBuilder Bldr2 (CheckedSet , Tmp, *currBldrCtx);
1971
+ StmtNodeBuilder Bldr2 (PreVisit , Tmp, *currBldrCtx);
1972
1972
1973
1973
bool HasRewrittenInit = false ;
1974
1974
const Expr *ArgE = nullptr ;
@@ -1982,12 +1982,11 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
1982
1982
llvm_unreachable (" unknown constant wrapper kind" );
1983
1983
1984
1984
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);
1991
1990
}
1992
1991
} else {
1993
1992
// If it's not rewritten, the contents of these expressions are not
@@ -2000,13 +1999,10 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
2000
1999
}
2001
2000
2002
2001
std::optional<SVal> ConstantVal = svalBuilder.getConstantVal (ArgE);
2003
- if (!ConstantVal)
2004
- ConstantVal = UnknownVal ();
2005
-
2006
2002
const LocationContext *LCtx = Pred->getLocationContext ();
2007
- for (auto *I : CheckedSet ) {
2003
+ for (auto *I : PreVisit ) {
2008
2004
ProgramStateRef State = I->getState ();
2009
- State = State->BindExpr (S, LCtx, * ConstantVal);
2005
+ State = State->BindExpr (S, LCtx, ConstantVal. value_or ( UnknownVal ()) );
2010
2006
if (IsTemporary)
2011
2007
State = createTemporaryRegionIfNeeded (State, LCtx, cast<Expr>(S),
2012
2008
cast<Expr>(S));
0 commit comments