[lli] Fix ArgV setup bug when running in -jit-kind=orc-lazy mode.

ArgV[ArgC] should be null.

llvm-svn: 343255
This commit is contained in:
Lang Hames 2018-09-27 19:27:19 +00:00
parent 0364f816bd
commit c9f389e152

View File

@ -851,9 +851,12 @@ int runOrcLazyJIT(const char *ProgName) {
std::vector<const char *> ArgV;
for (auto &Arg : Args)
ArgV.push_back(Arg.c_str());
ArgV.push_back(nullptr);
int ArgC = ArgV.size() - 1;
auto Main =
reinterpret_cast<MainFnPtr>(static_cast<uintptr_t>(MainSym.getAddress()));
auto Result = Main(ArgV.size(), (const char **)ArgV.data());
auto Result = Main(ArgC, (const char **)ArgV.data());
// Wait for -entry-point threads.
for (auto &AltEntryThread : AltEntryThreads)