diff options
author | Chris Lattner <sabre@nondot.org> | 2005-02-13 23:02:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-02-13 23:02:34 +0000 |
commit | ed5fa58a07d0383c239ab98d532f8f6047fbb215 (patch) | |
tree | 518cb9a102720a36f216eadb3b8e0c1f1e1a8541 /tools | |
parent | 946af52687fea113a6596385bfbdb26994709a37 (diff) | |
download | external_llvm-ed5fa58a07d0383c239ab98d532f8f6047fbb215.zip external_llvm-ed5fa58a07d0383c239ab98d532f8f6047fbb215.tar.gz external_llvm-ed5fa58a07d0383c239ab98d532f8f6047fbb215.tar.bz2 |
Make sure to null terminate argument lists!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gccld/GenerateCode.cpp | 3 | ||||
-rw-r--r-- | tools/gccld/gccld.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp index b189d06..1d4c520 100644 --- a/tools/gccld/GenerateCode.cpp +++ b/tools/gccld/GenerateCode.cpp @@ -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); diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp index 809db2a..00cf657 100644 --- a/tools/gccld/gccld.cpp +++ b/tools/gccld/gccld.cpp @@ -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"); |