Replace StringRef with std::string in LinkerDriver::addLibrary(StringRef Name) because std::string is destroyed after assigning what fills the buffer with garbage and StringRef is no more valid.
That fixes few failing tests under windows+msvs2015(debug).
llvm-svn: 259186
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 7909336..2b0789b 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -114,7 +114,7 @@
// Add a given library by searching it from input search paths.
void LinkerDriver::addLibrary(StringRef Name) {
- StringRef Path = searchLibrary(Name);
+ std::string Path = searchLibrary(Name);
if (Path.empty())
error("Unable to find library -l" + Name);
else