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
This commit is contained in:
George Rimar 2016-01-29 10:52:52 +00:00
parent 24785bd0b8
commit 2c9b7bd326
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ void LinkerDriver::addFile(StringRef Path) {
// 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