diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-07-18 21:16:15 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-07-18 21:16:15 +0000 |
commit | a001c1ce5fcb669624a5b8e50d0a629d673da901 (patch) | |
tree | cada599341c4f10668ae01dddbab09dff30ee4bb /lib/Driver/Tools.cpp | |
parent | 8d13d221cf7c1657404c611efaadf3ac19d899b3 (diff) |
Driver: Fix a possible use after free.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index f423d4e3b9..6e6dab1088 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1489,7 +1489,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddAllArgs(CmdArgs, options::OPT_undef); - std::string Exec = getToolChain().getDriver().getClangProgramPath(); + const char *Exec = getToolChain().getDriver().getClangProgramPath(); // Optionally embed the -cc1 level arguments into the debug info, for build // analysis. @@ -1509,7 +1509,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Args.MakeArgString(Flags.str())); } - Dest.addCommand(new Command(JA, *this, Exec.c_str(), CmdArgs)); + Dest.addCommand(new Command(JA, *this, Exec, CmdArgs)); // Explicitly warn that these options are unsupported, even though // we are allowing compilation to continue. @@ -1588,8 +1588,8 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Input.getFilename()); } - std::string Exec = getToolChain().getDriver().getClangProgramPath(); - Dest.addCommand(new Command(JA, *this, Exec.c_str(), CmdArgs)); + const char *Exec = getToolChain().getDriver().getClangProgramPath(); + Dest.addCommand(new Command(JA, *this, Exec, CmdArgs)); } void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA, |