Skip to content
Snippets Groups Projects
Commit 61a31c9f authored by Chris Lattner's avatar Chris Lattner
Browse files

Make sure to null terminate argument lists!

llvm-svn: 20166
parent 743dd2cd
No related branches found
No related tags found
No related merge requests found
......@@ -247,6 +247,7 @@ int llvm::GenerateAssembly(const std::string &OutputFilename,
args.push_back("-o");
args.push_back(OutputFilename.c_str());
args.push_back(InputFilename.c_str());
args.push_back(0);
return sys::Program::ExecuteAndWait(llc, &args[0]);
}
......@@ -263,6 +264,7 @@ int llvm::GenerateCFile(const std::string &OutputFile,
args.push_back("-o");
args.push_back(OutputFile.c_str());
args.push_back(InputFile.c_str());
args.push_back(0);
return sys::Program::ExecuteAndWait(llc, &args[0]);
}
......@@ -322,6 +324,7 @@ int llvm::GenerateNative(const std::string &OutputFilename,
args.push_back(Libraries[index].c_str());
}
}
args.push_back(0);
// Run the compiler to assembly and link together the program.
return sys::Program::ExecuteAndWait(gcc, &args[0], (const char**)clean_env);
......
......@@ -299,7 +299,7 @@ int main(int argc, char **argv, char **envp ) {
Libraries, gcc, envp );
// Remove the assembly language file.
AssemblyFile.destroyFile();;
AssemblyFile.destroyFile();
} else if (NativeCBE) {
sys::Path CFile (OutputFilename);
CFile.appendSuffix("cbe.c");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment