[clang] [clang][dataflow] Only propagate past CXXDefaultInitExpr if init is (PR #99236)
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 16 14:13:42 PDT 2024
================
@@ -465,7 +465,12 @@ class ResultObjectVisitor : public AnalysisASTVisitor<ResultObjectVisitor> {
}
if (auto *DIE = dyn_cast<CXXDefaultInitExpr>(E)) {
- PropagateResultObject(DIE->getExpr(), Loc);
+ // If it has a rewritten init, we should propagate to that. If it doesn't,
+ // then the CXXDefaultInitExpr is the only initializer available during
+ // the analysis as the underlying Expr is only traversed as a child of the
+ // Decl being initialized, which is not usually in the CFG.
+ if (DIE->hasRewrittenInit())
----------------
efriedma-quic wrote:
I don't understand how the rewriting is connected to propagation: I think you need to propagate whether or not the expression is rewritten? Or am I missing something about what this code is doing?
https://github.com/llvm/llvm-project/pull/99236
More information about the cfe-commits
mailing list