Skip to content

Commit edba286

Browse files
committed
[clangd] Fix stack-use-after-scope
Found by asan.
1 parent 2247f72 commit edba286

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎clang-tools-extra/clangd/ClangdServer.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,10 +750,10 @@ Context ClangdServer::createProcessingContext(PathRef File) const {
750750
return Context::current().clone();
751751

752752
config::Params Params;
753+
llvm::SmallString<256> PosixPath;
753754
if (!File.empty()) {
754755
assert(llvm::sys::path::is_absolute(File));
755-
llvm::SmallString<256> PosixPath = File;
756-
llvm::sys::path::native(PosixPath, llvm::sys::path::Style::posix);
756+
llvm::sys::path::native(File, PosixPath, llvm::sys::path::Style::posix);
757757
Params.Path = PosixPath.str();
758758
}
759759

0 commit comments

Comments
 (0)