mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Change the way entry function is called.
This commit is contained in:
parent
70279f8679
commit
4a9d08d1b0
1 changed files with 10 additions and 2 deletions
|
|
@ -112,11 +112,19 @@ ReturnCode ExecutionEngine::run(ExecBundle const& _exec, RuntimeData* _data, Env
|
|||
ReturnCode returnCode;
|
||||
Runtime runtime(_data, _env);
|
||||
|
||||
|
||||
std::vector<llvm::GenericValue> args{{}, llvm::GenericValue(&runtime)};
|
||||
llvm::GenericValue result;
|
||||
|
||||
typedef ReturnCode(*EntryFuncPtr)(int, Runtime*);
|
||||
|
||||
auto entryFuncVoidPtr = _exec.engine->getPointerToFunction(_exec.entryFunc);
|
||||
auto entryFuncPtr = static_cast<EntryFuncPtr>(entryFuncVoidPtr);
|
||||
|
||||
auto r = setjmp(runtime.getJmpBuf());
|
||||
if (r == 0)
|
||||
{
|
||||
auto result = _exec.engine->runFunction(_exec.entryFunc, {{}, llvm::GenericValue(&runtime)});
|
||||
returnCode = static_cast<ReturnCode>(result.IntVal.getZExtValue());
|
||||
returnCode = entryFuncPtr(0, &runtime);
|
||||
}
|
||||
else
|
||||
returnCode = static_cast<ReturnCode>(r);
|
||||
|
|
|
|||
Loading…
Reference in a new issue