sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Thanks, I'd seen these crashes but not manage to track down yet!

LG with one fix



================
Comment at: clang-tools-extra/clangd/index/Index.cpp:81
 SwapIndex::indexedFiles() const {
-  return snapshot()->indexedFiles();
+  return [KeepAlive = snapshot(), IndexedFiles = snapshot()->indexedFiles()](
+             llvm::StringRef File) { return IndexedFiles(File); };
----------------
Calling snapshot() twice introduces a race - we may keep the wrong one alive.

Evaluate snapshot first into a variable, then call indexedFiles, then move both 
into the lambda?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95206/new/

https://reviews.llvm.org/D95206

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to