From: Adrian Prantl Date: Tue, 23 Apr 2019 15:44:19 +0000 (+0000) Subject: Revert "[dsymutil] Fix use-after-free when sys::path::append grows the buffer." X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2bf9685e96d3f4dd0d91cd33978a1f1fe82ae983;p=llvm Revert "[dsymutil] Fix use-after-free when sys::path::append grows the buffer." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359002 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/dsymutil/dsymutil.cpp b/tools/dsymutil/dsymutil.cpp index d14dff061d0..32569846361 100644 --- a/tools/dsymutil/dsymutil.cpp +++ b/tools/dsymutil/dsymutil.cpp @@ -328,7 +328,7 @@ static Expected getOutputFileName(llvm::StringRef InputFile) { return std::move(E); llvm::sys::path::append(Path, "Contents", "Resources"); - std::string ResourceDir = Path; + StringRef ResourceDir = Path; llvm::sys::path::append(Path, "DWARF", llvm::sys::path::filename(DwarfFile)); return OutputLocation(Path.str(), ResourceDir.str()); }