summaryrefslogtreecommitdiff
path: root/tools/llvmc/CompilerDriver.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-04-11 05:48:04 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-04-11 05:48:04 +0000
commitc30088f9612c949b047884deab045e2421690691 (patch)
tree1480ac3653e57090359d68159d2dcf218e8af6d6 /tools/llvmc/CompilerDriver.cpp
parent01c5513683559a4dbef774a6a5183a1cf2b47869 (diff)
downloadllvm-c30088f9612c949b047884deab045e2421690691.tar.gz
llvm-c30088f9612c949b047884deab045e2421690691.tar.bz2
llvm-c30088f9612c949b047884deab045e2421690691.tar.xz
Ensure that the arguments passed to sys::Program::ExecuteAndWait include
the program name as the first argument. Thanks go to Markus Oberhumer for noticing this problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21220 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc/CompilerDriver.cpp')
-rw-r--r--tools/llvmc/CompilerDriver.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/llvmc/CompilerDriver.cpp b/tools/llvmc/CompilerDriver.cpp
index 6d609c52aa..1a316c8439 100644
--- a/tools/llvmc/CompilerDriver.cpp
+++ b/tools/llvmc/CompilerDriver.cpp
@@ -394,8 +394,9 @@ private:
// Invoke the program
const char** Args = (const char**)
- alloca(sizeof(const char*)*(action->args.size()+1));
- for (unsigned i = 0; i != action->args.size(); ++i)
+ alloca(sizeof(const char*)*(action->args.size()+2));
+ Args[0] = action->program.toString().c_str();
+ for (unsigned i = 1; i != action->args.size(); ++i)
Args[i] = action->args[i].c_str();
Args[action->args.size()] = 0; // null terminate list.
if (isSet(TIME_ACTIONS_FLAG)) {