================ @@ -2170,6 +2172,12 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, PopExpressionEvaluationContext(); + sema::AnalysisBasedWarnings::Policy WP = + AnalysisWarnings.getPolicyInEffectAt(EndLoc); + // We cannot release LSI until we finish computing captures, which + // requires the scope to be popped. + PoppedFunctionScopePtr _ = PopFunctionScopeInfo(&WP, LSI->CallOperator); ---------------- AaronBallman wrote:
This is causing a use-after-free that CI is hitting: https://github.com/llvm/llvm-project/pull/154342 https://github.com/llvm/llvm-project/pull/154347 because `LSI` is used outside of this block: https://github.com/llvm/llvm-project/blob/5cc8c92268cb82d8b2cb771d6e87bc816a4555f9/clang/lib/Sema/SemaLambda.cpp#L2315 https://github.com/llvm/llvm-project/blob/5cc8c92268cb82d8b2cb771d6e87bc816a4555f9/clang/lib/Sema/SemaLambda.cpp#L2347 Perhaps we should revert the changes until that's fixed? https://github.com/llvm/llvm-project/pull/154106 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits