[clangd][SwapIndex] ensure that the old index is alive while we are using it...
[clangd][SwapIndex] ensure that the old index is alive while we are using it via the function returned by `SwapIndex::indexedFiles()` call Without this patch the old index could be freed, but there still could be tries to access it via the function returned by `SwapIndex::indexedFiles()` call. This leads to hard to reproduce clangd crashes at code completion. This patch keeps the old index alive until the function returned by `SwapIndex::indexedFiles()` call is alive. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D95206
Loading
Please sign in to comment