[clangd] Fix stack-use-after-scope

Found by asan.
This commit is contained in:
Benjamin Kramer 2020-07-05 17:09:08 +02:00
parent 2247f7218a
commit edba2864a7
1 changed files with 2 additions and 2 deletions

View File

@ -750,10 +750,10 @@ Context ClangdServer::createProcessingContext(PathRef File) const {
return Context::current().clone();
config::Params Params;
llvm::SmallString<256> PosixPath;
if (!File.empty()) {
assert(llvm::sys::path::is_absolute(File));
llvm::SmallString<256> PosixPath = File;
llvm::sys::path::native(PosixPath, llvm::sys::path::Style::posix);
llvm::sys::path::native(File, PosixPath, llvm::sys::path::Style::posix);
Params.Path = PosixPath.str();
}