aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-05-08 05:22:11 +0200
committerGitHub <noreply@github.com>2025-05-08 05:22:11 +0200
commitdc28f9d087324f77db81e7192648a17ebf036125 (patch)
treed3e24af08c37a4c90a76306f45df51e988055ceb /clang/lib/AST/ExprConstant.cpp
parenteebb50afaf27961b21847950179febdd20a98866 (diff)
downloadllvm-dc28f9d087324f77db81e7192648a17ebf036125.zip
llvm-dc28f9d087324f77db81e7192648a17ebf036125.tar.gz
llvm-dc28f9d087324f77db81e7192648a17ebf036125.tar.bz2
[clang][ExprConstant] Bail out on invalid lambda capture inits (#138832)
Fixes https://github.com/llvm/llvm-project/issues/138824
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r--clang/lib/AST/ExprConstant.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index e5950f4..500d43a 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -11038,7 +11038,7 @@ bool RecordExprEvaluator::VisitLambdaExpr(const LambdaExpr *E) {
// If there is no initializer, either this is a VLA or an error has
// occurred.
- if (!CurFieldInit)
+ if (!CurFieldInit || CurFieldInit->containsErrors())
return Error(E);
LValue Subobject = This;