mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Fix a trivial use after free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109363 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
13f03f0006
commit
97595eb05c
@ -721,6 +721,10 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
|
|||||||
|
|
||||||
std::vector<const char *> ProgramArgs;
|
std::vector<const char *> ProgramArgs;
|
||||||
|
|
||||||
|
// Declared here so that the destructor only runs after
|
||||||
|
// ProgramArgs is used.
|
||||||
|
std::string Exec;
|
||||||
|
|
||||||
if (RemoteClientPath.isEmpty())
|
if (RemoteClientPath.isEmpty())
|
||||||
ProgramArgs.push_back(OutputBinary.c_str());
|
ProgramArgs.push_back(OutputBinary.c_str());
|
||||||
else {
|
else {
|
||||||
@ -741,7 +745,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
|
|||||||
// Full path to the binary. We need to cd to the exec directory because
|
// Full path to the binary. We need to cd to the exec directory because
|
||||||
// there is a dylib there that the exec expects to find in the CWD
|
// there is a dylib there that the exec expects to find in the CWD
|
||||||
char* env_pwd = getenv("PWD");
|
char* env_pwd = getenv("PWD");
|
||||||
std::string Exec = "cd ";
|
Exec = "cd ";
|
||||||
Exec += env_pwd;
|
Exec += env_pwd;
|
||||||
Exec += "; ./";
|
Exec += "; ./";
|
||||||
Exec += OutputBinary.c_str();
|
Exec += OutputBinary.c_str();
|
||||||
|
Loading…
Reference in New Issue
Block a user