|
@ -9,20 +9,21 @@ namespace eth |
|
|
namespace jit |
|
|
namespace jit |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
Runtime::Runtime(RuntimeData* _data, Env* _env) : |
|
|
void Runtime::init(RuntimeData* _data, Env* _env) |
|
|
m_data(*_data), |
|
|
{ |
|
|
m_env(*_env) |
|
|
m_data = _data; |
|
|
{} |
|
|
m_env = _env; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
bytes_ref Runtime::getReturnData() const |
|
|
bytes_ref Runtime::getReturnData() const |
|
|
{ |
|
|
{ |
|
|
auto data = m_data.callData; |
|
|
auto data = m_data->callData; |
|
|
auto size = static_cast<size_t>(m_data.callDataSize); |
|
|
auto size = static_cast<size_t>(m_data->callDataSize); |
|
|
|
|
|
|
|
|
if (data < m_memData || data >= m_memData + m_memSize || size == 0) |
|
|
if (data < m_memData || data >= m_memData + m_memSize || size == 0) |
|
|
{ |
|
|
{ |
|
|
assert(size == 0); // data can be an invalid pointer only if size is 0
|
|
|
assert(size == 0); // data can be an invalid pointer only if size is 0
|
|
|
m_data.callData = nullptr; |
|
|
m_data->callData = nullptr; |
|
|
return {}; |
|
|
return {}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|