Fixes an additional temporary string use.
authorRui Ueyama <ruiu@google.com>
Fri, 23 Aug 2013 22:06:29 +0000 (22:06 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 23 Aug 2013 22:06:29 +0000 (22:06 +0000)
Patch by Ron Ofir.

llvm-svn: 189151

lld/lib/Driver/WinLinkDriver.cpp

index bd39dcd..e691394 100644 (file)
@@ -410,7 +410,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[],
     SmallString<128> firstInputFilePath =
         (llvm::dyn_cast<FileNode>(&((inputGraph)[0])))->path(ctx);
     (llvm::sys::path::replace_extension(firstInputFilePath, ".exe"));
-    ctx.setOutputPath(firstInputFilePath.str());
+    ctx.setOutputPath(ctx.allocateString(firstInputFilePath.str()));
   }
 
   // Validate the combination of options used.