Skip to content

Commit

Permalink
cpp: Add execute() overloading without evmc_context parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed May 29, 2019
1 parent 89a4e8f commit 1b7104e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions include/evmc/evmc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,21 @@ class vm
return result{m_instance->execute(m_instance, &ctx, rev, &msg, code, code_size)};
}

/// Executes code without the Host context.
///
/// The same as
/// execute(evmc_context&, evmc_revision, const evmc_message&, const uint8_t*, size_t),
/// but without providing the Host context.
/// This method is for experimental precompiles support where execution is guaranteed
/// not to require any Host access.
result execute(evmc_revision rev,
const evmc_message& msg,
const uint8_t* code,
size_t code_size) noexcept
{
return result{m_instance->execute(m_instance, nullptr, rev, &msg, code, code_size)};
}

private:
evmc_instance* const m_instance = nullptr;
};
Expand Down

0 comments on commit 1b7104e

Please sign in to comment.