Ensure that the arguments passed to sys::Program::ExecuteAndWait include
[oota-llvm.git] / tools / llvmc / CompilerDriver.cpp
index 6d609c52aa6d855f71103dd2576fc798e11ee215..1a316c84390bbb471b9f35ede6495096a50257f1 100644 (file)
@@ -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)) {