From dbc1a58fa5156a346013e9db75fe299168708bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 6 Nov 2019 20:45:31 +0100 Subject: [PATCH] Upgrade EVMC to version 7.0.0 --- evmc | 2 +- lib/evmone/analysis.hpp | 2 +- lib/evmone/execution.cpp | 6 +++--- lib/evmone/execution.hpp | 4 ++-- test/bench/bench.cpp | 3 +-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/evmc b/evmc index 26dbc05995..e770f78819 160000 --- a/evmc +++ b/evmc @@ -1 +1 @@ -Subproject commit 26dbc05995a1f389e0881a4519ae76c523487405 +Subproject commit e770f788191baeb3246563390e507bcd5644c24e 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..331815a1e2 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