3#include <sysio/vm/wasm_stack.hpp>
4#include <sysio/vm/utils.hpp>
5#include <sysio/vm/exceptions.hpp>
9namespace sysio {
namespace vm {
13 struct execution_interface {
25 auto result =
memory + ptr;
32 SYS_VM_ASSERT(
len <= std::numeric_limits<wasm_size_t>::max() / (
wasm_size_t)
sizeof(
T), wasm_interpreter_exception,
"length will overflow" );
33 volatile auto check_addr = *(
reinterpret_cast<const char*
>(ptr) + (
len *
sizeof(
T)) - 1);
38 auto result =
memory + ptr;
44 volatile auto check_addr = std::strlen(
static_cast<const char*
>(ptr));
ElemT & get_back(size_t i)
void ignore_unused_variable_warning(T &...)
std::uint32_t wasm_size_t
#define T(meth, val, expected)
void * get_memory() const
void trim_operands(std::size_t amt)
void push_operand(T &&op)
void * validate_null_terminated_pointer(wasm_ptr_t ptr) const
execution_interface(char *memory, operand_stack *os)
void * validate_pointer(wasm_ptr_t ptr, wasm_size_t len) const
void validate_pointer(const void *ptr, wasm_size_t len) const
const auto & operand_from_back(std::size_t index) const
void validate_null_terminated_pointer(const void *ptr) const
#define SYS_VM_ASSERT(expr, exc_type, msg)