diff options
| author | Lang Hames <lhames@gmail.com> | 2020-01-11 12:58:38 -0800 | 
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2020-01-11 13:03:38 -0800 | 
| commit | 2cdb18afda841392002feafda21af31854c195b3 (patch) | |
| tree | a3282082b1a69db4838dfdf4333b171dcfbd0a2a /llvm/lib/ExecutionEngine | |
| parent | a1f16998f371870ca4da8b3c00a093c607a36ddd (diff) | |
| download | bcm5719-llvm-2cdb18afda841392002feafda21af31854c195b3.tar.gz bcm5719-llvm-2cdb18afda841392002feafda21af31854c195b3.zip  | |
[ORC] Fix argv handling in runAsMain / lli.
This fixes an off-by-one error in the argc value computed by runAsMain, and
switches lli back to using the input bitcode (rather than the string "lli") as
the effective program name.
Thanks to Stefan Graenitz for spotting the bug.
Diffstat (limited to 'llvm/lib/ExecutionEngine')
| -rw-r--r-- | llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp | 2 | 
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp index 0a57348dd3d..3d97fe9eeab 100644 --- a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp +++ b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp @@ -42,7 +42,7 @@ int runAsMain(int (*Main)(int, char *[]), ArrayRef<std::string> Args,    }    ArgV.push_back(nullptr); -  return Main(Args.size(), ArgV.data()); +  return Main(Args.size() + !!ProgramName, ArgV.data());  }  CtorDtorIterator::CtorDtorIterator(const GlobalVariable *GV, bool End)  | 

