diff --git a/lldb/test/API/functionalities/exec/main.cpp b/lldb/test/API/functionalities/exec/main.cpp index bec470fd13ef..51c67d5f232d 100644 --- a/lldb/test/API/functionalities/exec/main.cpp +++ b/lldb/test/API/functionalities/exec/main.cpp @@ -12,7 +12,8 @@ int main(int argc, char const **argv) { std::string directory_name(::dirname(buf)); std::string other_program = directory_name + "/secondprog"; - execve(other_program.c_str(), const_cast(argv), nullptr); + argv[0] = other_program.c_str(); + execv(argv[0], const_cast(argv)); perror("execve"); abort(); }