diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2005-04-11 05:48:04 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2005-04-11 05:48:04 +0000 |
| commit | 7a763bfbc51e6985886f5b5741a3efd5dca6760d (patch) | |
| tree | 84f88791831a6117e873ed572c62fbfd66adf611 /llvm/tools/llvmc/CompilerDriver.cpp | |
| parent | a3b14581753b678ad55e3a0cd8ca21b597a55a38 (diff) | |
| download | bcm5719-llvm-7a763bfbc51e6985886f5b5741a3efd5dca6760d.tar.gz bcm5719-llvm-7a763bfbc51e6985886f5b5741a3efd5dca6760d.zip | |
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.
llvm-svn: 21220
Diffstat (limited to 'llvm/tools/llvmc/CompilerDriver.cpp')
| -rw-r--r-- | llvm/tools/llvmc/CompilerDriver.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/llvmc/CompilerDriver.cpp b/llvm/tools/llvmc/CompilerDriver.cpp index 6d609c52aa6..1a316c84390 100644 --- a/llvm/tools/llvmc/CompilerDriver.cpp +++ b/llvm/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)) { |

