diff --git a/evmc b/evmc index 26dbc05995..1bb7ccd7a4 160000 --- a/evmc +++ b/evmc @@ -1 +1 @@ -Subproject commit 26dbc05995a1f389e0881a4519ae76c523487405 +Subproject commit 1bb7ccd7a4137b537ca6705d05f4b0af11059ce5 diff --git a/lib/evmone/analysis.hpp b/lib/evmone/analysis.hpp index 87dc451d72..6261e1f887 100644 --- a/lib/evmone/analysis.hpp +++ b/lib/evmone/analysis.hpp @@ -132,7 +132,7 @@ struct execution_state const uint8_t* code = nullptr; size_t code_size = 0; - evmc::HostContext host{nullptr}; + evmc::HostContext host; evmc_revision rev = {}; diff --git a/lib/evmone/execution.cpp b/lib/evmone/execution.cpp index e726789091..57cc12f970 100644 --- a/lib/evmone/execution.cpp +++ b/lib/evmone/execution.cpp @@ -8,8 +8,8 @@ namespace evmone { -evmc_result execute(evmc_vm* /*unused*/, evmc_host_context* ctx, evmc_revision rev, - const evmc_message* msg, const uint8_t* code, size_t code_size) noexcept +evmc_result execute(evmc_vm* /*unused*/, const evmc_host_interface* host, evmc_host_context* ctx, + evmc_revision rev, const evmc_message* msg, const uint8_t* code, size_t code_size) noexcept { auto analysis = analyze(rev, code, code_size); @@ -18,7 +18,7 @@ evmc_result execute(evmc_vm* /*unused*/, evmc_host_context* ctx, evmc_revision r state->msg = msg; state->code = code; state->code_size = code_size; - state->host = evmc::HostContext{ctx}; + state->host = evmc::HostContext{host, ctx}; state->gas_left = msg->gas; state->rev = rev; diff --git a/lib/evmone/execution.hpp b/lib/evmone/execution.hpp index cbee2a5c9d..ab380e7a29 100644 --- a/lib/evmone/execution.hpp +++ b/lib/evmone/execution.hpp @@ -7,6 +7,6 @@ namespace evmone { -evmc_result execute(evmc_vm* vm, evmc_host_context* ctx, evmc_revision rev, const evmc_message* msg, - const uint8_t* code, size_t code_size) noexcept; +evmc_result execute(evmc_vm* vm, const evmc_host_interface* host, evmc_host_context* ctx, + evmc_revision rev, const evmc_message* msg, const uint8_t* code, size_t code_size) noexcept; } // namespace evmone diff --git a/test/bench/bench.cpp b/test/bench/bench.cpp index 72bfe4c30a..a8d6ea8c4a 100644 --- a/test/bench/bench.cpp +++ b/test/bench/bench.cpp @@ -38,8 +38,7 @@ inline evmc::result execute(bytes_view code, bytes_view input) noexcept msg.gas = gas_limit; msg.input_data = input.data(); msg.input_size = input.size(); - auto null_ctx = evmc_host_context{}; - return vm.execute(null_ctx, EVMC_CONSTANTINOPLE, msg, code.data(), code.size()); + return vm.execute(EVMC_CONSTANTINOPLE, msg, code.data(), code.size()); } void execute(State& state, bytes_view code, bytes_view input) noexcept