[cfe-commits] r130833 - /cfe/trunk/lib/Driver/Tools.cpp
Nick Lewycky
nicholas at mxc.ca
Tue May 3 20:44:02 PDT 2011
Author: nicholas
Date: Tue May 3 22:44:01 2011
New Revision: 130833
URL: http://llvm.org/viewvc/llvm-project?rev=130833&view=rev
Log:
No, fix this use after free properly.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=130833&r1=130832&r2=130833&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue May 3 22:44:01 2011
@@ -643,9 +643,8 @@
CmdArgs.push_back("-target-abi");
CmdArgs.push_back(ABIName);
- std::string MArch;
if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) {
- MArch = A->getValue(Args);
+ llvm::StringRef MArch = A->getValue(Args);
CmdArgs.push_back("-target-cpu");
if ((MArch == "r2000") || (MArch == "r3000"))
@@ -653,7 +652,7 @@
else if (MArch == "r6000")
CmdArgs.push_back("mips2");
else
- CmdArgs.push_back(MArch.c_str());
+ CmdArgs.push_back(Args.MakeArgString(MArch));
}
// Select the float ABI as determined by -msoft-float, -mhard-float, and
More information about the cfe-commits
mailing list