]> granicus.if.org Git - clang/commitdiff
Fix potential use after free.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 26 Dec 2011 14:18:37 +0000 (14:18 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 26 Dec 2011 14:18:37 +0000 (14:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147277 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index 883899d45b6100b892c59644491a0c8ebc531053..41ff1102bfc88e7160a1f4bbe079201cc31e905e 100644 (file)
@@ -800,9 +800,8 @@ void Clang::AddSparcTargetArgs(const ArgList &Args,
   const Driver &D = getToolChain().getDriver();
 
   if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) {
-    StringRef MArch = A->getValue(Args);
     CmdArgs.push_back("-target-cpu");
-    CmdArgs.push_back(MArch.str().c_str());
+    CmdArgs.push_back(A->getValue(Args));
   }
 
   // Select the float ABI as determined by -msoft-float, -mhard-float, and