diff --git a/libevmjit-cpp/Env.cpp b/libevmjit-cpp/Env.cpp index 39007c59d..42a0b1e12 100644 --- a/libevmjit-cpp/Env.cpp +++ b/libevmjit-cpp/Env.cpp @@ -86,18 +86,16 @@ extern "C" if (*io_gas < 0) return false; + auto ret = false; + auto callGas = u256{_callGas}; if (_env->balance(_env->myAddress) >= value && _env->depth < 1024) { _env->subBalance(value); - auto inRef = bytesConstRef{_inBeg, _inSize}; - auto outRef = bytesRef{_outBeg, _outSize}; - u256 callGas = _callGas; - auto ret = _env->call(receiveAddress, value, inRef, callGas, outRef, {}, {}, codeAddress); - *io_gas += static_cast(callGas); // It is never more than initial _callGas - return ret; + ret = _env->call(receiveAddress, value, {_inBeg, _inSize}, callGas, {_outBeg, _outSize}, {}, {}, codeAddress); } - return false; + *io_gas += static_cast(callGas); // it is never more than initial _callGas + return ret; } EXPORT void env_sha3(byte* _begin, uint64_t _size, h256* o_hash)