[PATCH] D159363: [clangd] SIGSEGV at clangd: DiagnosticConsumer Is Used After Free
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 1 08:57:37 PDT 2023
sammccall added inline comments.
================
Comment at: clang-tools-extra/clangd/Preamble.cpp:610-619
StoreDiags PreambleDiagnostics;
PreambleDiagnostics.setDiagCallback(
[&ASTListeners](const clang::Diagnostic &D, clangd::Diag &Diag) {
llvm::for_each(ASTListeners,
[&](const auto &L) { L->sawDiagnostic(D, Diag); });
});
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> PreambleDiagsEngine =
----------------
ivanmurashko wrote:
> Alternative fix
I prefer the version in the patch: we keep PreambleDiagnostics auto-scoped and can more easily reason about its lifetime.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159363/new/
https://reviews.llvm.org/D159363
More information about the cfe-commits
mailing list