diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-12-12 00:47:19 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-12-12 00:47:19 +0000 |
commit | 1f147379b7a7b811d5ce67d5cd88290957dae19c (patch) | |
tree | 382daaa5a700fa64e16131beae70e767b216668f | |
parent | Update release notes for PR86 and C++ support (diff) | |
download | llvm-project-1f147379b7a7b811d5ce67d5cd88290957dae19c.tar.gz llvm-project-1f147379b7a7b811d5ce67d5cd88290957dae19c.tar.bz2 llvm-project-1f147379b7a7b811d5ce67d5cd88290957dae19c.zip |
Add an assertion to make sure we are at least getting argv[0] right.
Use a clearer error message when we fail to load a program.
llvm-svn: 10414
-rw-r--r-- | llvm/tools/lli/lli.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 82b354dc18a5..0547c433cb9f 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -120,6 +120,7 @@ int callAsMain(ExecutionEngine *EE, ModuleProvider *MP, GVArgc.IntVal = Args.size(); GVArgs.push_back(GVArgc); // Arg #0 = argc. GVArgs.push_back(PTOGV(CreateArgv(EE, Args))); // Arg #1 = argv. + assert(((char **)GVTOP(GVArgs[1]))[0] && "argv[0] was null after CreateArgv"); GVArgs.push_back(PTOGV(CreateArgv(EE, EnvVars))); // Arg #2 = envp. return EE->run(Fn, GVArgs).IntVal; } @@ -137,7 +138,7 @@ int main(int argc, char **argv, char * const *envp) { try { MP = getBytecodeModuleProvider(InputFile); } catch (std::string &err) { - std::cerr << "Error parsing '" << InputFile << "': " << err << "\n"; + std::cerr << "Error loading program '" << InputFile << "': " << err << "\n"; exit(1); } |