================
@@ -3193,20 +3193,20 @@ void ExprEngine::VisitCommonDeclRefExpr(const Expr *Ex,
const NamedDecl *D,
void ExprEngine::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *Ex,
ExplodedNode *Pred,
ExplodedNodeSet &Dst) {
+ const Expr *Arr = Ex->getCommonExpr()->getSourceExpr();
+
ExplodedNodeSet CheckerPreStmt;
getCheckerManager().runCheckersForPreStmt(CheckerPreStmt, Pred, Ex, *this);
ExplodedNodeSet EvalSet;
- NodeBuilder Bldr(CheckerPreStmt, EvalSet, *currBldrCtx);
-
- const Expr *Arr = Ex->getCommonExpr()->getSourceExpr();
+ if (isa<CXXConstructExpr>(Ex->getSubExpr())) {
+ // The constructor visitior has already taken care of everything, so let's
+ // skip forward to the PostStmt handling after the 'for' loop.
+ EvalSet.insert(CheckerPreStmt);
+ CheckerPreStmt.clear();
+ }
----------------
steakhal wrote:
This comment was pretty confusing because I was expecting the subsequent loop
to be conditional, while in fact this it is unconditional but the range is
cleared. I think that `clear` call needs to stand out more.
https://github.com/llvm/llvm-project/pull/204354
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits