From 3764510fd97790b27454423341412cec639de9df Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 27 Sep 2018 19:27:19 +0000 Subject: [PATCH] [lli] Fix ArgV setup bug when running in -jit-kind=orc-lazy mode. ArgV[ArgC] should be null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343255 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/lli/lli.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 49d5db13326..4977cccabda 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -851,9 +851,12 @@ int runOrcLazyJIT(const char *ProgName) { std::vector ArgV; for (auto &Arg : Args) ArgV.push_back(Arg.c_str()); + ArgV.push_back(nullptr); + + int ArgC = ArgV.size() - 1; auto Main = reinterpret_cast(static_cast(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) -- 2.11.0