[PECOFF] Fix use-after-free.
authorRui Ueyama <ruiu@google.com>
Sat, 20 Jul 2013 21:00:47 +0000 (21:00 +0000)
committerRui Ueyama <ruiu@google.com>
Sat, 20 Jul 2013 21:00:47 +0000 (21:00 +0000)
llvm-svn: 186771

lld/lib/ReaderWriter/PECOFF/PECOFFTargetInfo.cpp

index 8c23523..0d5a359 100644 (file)
@@ -57,7 +57,7 @@ bool PECOFFTargetInfo::validateImpl(raw_ostream &diagnostics) {
 /// Append the given file to the input file list. The file must be an object
 /// file or an import library file.
 bool PECOFFTargetInfo::appendInputFileOrLibrary(std::string path) {
-  StringRef ext = llvm::sys::path::extension(path).lower();
+  std::string ext = llvm::sys::path::extension(path).lower();
   // This is an import library file. Look for the library file in the search
   // paths, unless the path contains a directory name.
   if (ext == ".lib") {