[PATCH] D138047: Fix use of dangling stack allocated string in IncludeFixer
David Goldman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 15 10:51:13 PST 2022
dgoldman created this revision.
dgoldman added a reviewer: kadircet.
Herald added a subscriber: arphaman.
Herald added a project: All.
dgoldman requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.
IncludeFixer uses this BuildDir string later on if given relative paths.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D138047
Files:
clang-tools-extra/clangd/Headers.h
Index: clang-tools-extra/clangd/Headers.h
===================================================================
--- clang-tools-extra/clangd/Headers.h
+++ clang-tools-extra/clangd/Headers.h
@@ -250,7 +250,7 @@
private:
StringRef FileName;
StringRef Code;
- StringRef BuildDir;
+ std::string BuildDir;
HeaderSearch *HeaderSearchInfo = nullptr;
llvm::StringSet<> IncludedHeaders; // Both written and resolved.
tooling::HeaderIncludes Inserter; // Computers insertion replacement.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138047.475522.patch
Type: text/x-patch
Size: 495 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221115/7d38fa25/attachment.bin>
More information about the cfe-commits
mailing list