mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10414 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2d9d4e740b
commit
3f6e798a14
@ -120,6 +120,7 @@ int callAsMain(ExecutionEngine *EE, ModuleProvider *MP,
|
|||||||
GVArgc.IntVal = Args.size();
|
GVArgc.IntVal = Args.size();
|
||||||
GVArgs.push_back(GVArgc); // Arg #0 = argc.
|
GVArgs.push_back(GVArgc); // Arg #0 = argc.
|
||||||
GVArgs.push_back(PTOGV(CreateArgv(EE, Args))); // Arg #1 = argv.
|
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.
|
GVArgs.push_back(PTOGV(CreateArgv(EE, EnvVars))); // Arg #2 = envp.
|
||||||
return EE->run(Fn, GVArgs).IntVal;
|
return EE->run(Fn, GVArgs).IntVal;
|
||||||
}
|
}
|
||||||
@ -137,7 +138,7 @@ int main(int argc, char **argv, char * const *envp) {
|
|||||||
try {
|
try {
|
||||||
MP = getBytecodeModuleProvider(InputFile);
|
MP = getBytecodeModuleProvider(InputFile);
|
||||||
} catch (std::string &err) {
|
} catch (std::string &err) {
|
||||||
std::cerr << "Error parsing '" << InputFile << "': " << err << "\n";
|
std::cerr << "Error loading program '" << InputFile << "': " << err << "\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user