Wire Sysio Wire Sysion 1.0.0
|
Classes | |
struct | eos_vm_oc_execution_interface |
struct | eos_vm_oc_type_converter |
class | eosvmoc_instantiated_module |
class | eosvmoc_runtime |
struct | result_resolver |
struct | wasm_function_type_provider |
struct | wasm_function_type_provider< Ret(Args...)> |
struct | wasm_to_rvalue_type |
struct | wasm_to_rvalue_type< F32 > |
struct | wasm_to_rvalue_type< F64 > |
struct | wasm_to_rvalue_type< U32 > |
struct | wasm_to_rvalue_type< U64 > |
struct | wasm_to_rvalue_type< void > |
struct | wasm_to_value_type |
struct | wasm_to_value_type< F32 > |
struct | wasm_to_value_type< F64 > |
struct | wasm_to_value_type< U32 > |
struct | wasm_to_value_type< U64 > |
Functions | |
template<typename T > | |
void * | array_ptr_impl (size_t ptr, size_t length) |
char * | null_terminated_ptr_impl (uint64_t ptr) |
auto | convert_native_to_wasm (char *ptr) |
template<typename Args , std::size_t... Is> | |
auto | get_ct_args (std::index_sequence< Is... >) |
uint32_t | make_native_type (vm::i32_const_t x) |
uint64_t | make_native_type (vm::i64_const_t x) |
float | make_native_type (vm::f32_const_t x) |
double | make_native_type (vm::f64_const_t x) |
template<typename TC , typename Args , std::size_t... Is> | |
auto | get_ct_args_one (std::index_sequence< Is... >) |
template<typename TC , typename T > | |
auto | get_ct_args_i () |
template<auto F, typename Interface , typename Preconditions , bool is_injected, typename... A> | |
auto | fn (A... a) |
template<auto F, typename Preconditions , typename Args , bool is_injected, std::size_t... Is> | |
constexpr auto | create_function (std::index_sequence< Is... >) |
template<auto F, typename Preconditions , bool is_injected> | |
constexpr auto | create_function () |
template<auto F, bool injected, typename Preconditions , typename Name > | |
void | register_eosvm_oc (Name n) |
Variables | |
template<typename T > | |
constexpr auto | wasm_to_value_type_v = wasm_to_value_type<T>::value |
template<typename T > | |
constexpr auto | wasm_to_rvalue_type_v = wasm_to_rvalue_type<T>::value |
|
inline |
validate an in-wasm-memory array
T |
When a pointer will be invalid we want to stop execution right here right now. This is accomplished by forcing a read from an address that must always be bad. A better approach would probably be to call in to a function that notes the invalid parameter and host function and then bubbles up a more useful error message; maybe some day. Prior to WASM_LIMITS the code just simply did a load from address 33MB via an immediate. 33MB was always invalid since 33MB was the most WASM memory you could have. Post WASM_LIMITS you theoretically could have up to 4GB, but we can't do a load from a 4GB immediate since immediates are limited to signed 32bit ranges.
So instead access the first_invalid_memory_address which by its name will always be invalid. Or will it? No... it won't, since it's initialized to -1*64KB in the case WASM has no memory! We actually cannot clamp first_invalid_memory_address to 0 during initialization in such a case since there is some historical funny business going on when end==0 (note how jle will pass when end==0 & first_invalid_memory_address==0)
So instead just bump first_invalid_memory_address another 64KB before accessing it. If it's -64KB it'll go to 0 which fails correctly in that case. If it's 4GB it'll go to 4GB+64KB which still fails too (there is an entire 8GB range of WASM memory set aside). There are other more straightforward ways of accomplishing this, but at least this approach has zero overhead (e.g. no additional register usage, etc) in the nominal case.
Definition at line 63 of file sys-vm-oc.hpp.
|
inline |
Definition at line 122 of file sys-vm-oc.hpp.
|
constexpr |
Definition at line 376 of file sys-vm-oc.hpp.
|
constexpr |
Definition at line 371 of file sys-vm-oc.hpp.
auto sysio::chain::webassembly::eosvmoc::fn | ( | A... | a | ) |
Definition at line 336 of file sys-vm-oc.hpp.
auto sysio::chain::webassembly::eosvmoc::get_ct_args | ( | std::index_sequence< Is... > | ) |
Definition at line 321 of file sys-vm-oc.hpp.
auto sysio::chain::webassembly::eosvmoc::get_ct_args_i | ( | ) |
Definition at line 311 of file sys-vm-oc.hpp.
auto sysio::chain::webassembly::eosvmoc::get_ct_args_one | ( | std::index_sequence< Is... > | ) |
Definition at line 306 of file sys-vm-oc.hpp.
|
inline |
Definition at line 302 of file sys-vm-oc.hpp.
|
inline |
Definition at line 303 of file sys-vm-oc.hpp.
|
inline |
Definition at line 300 of file sys-vm-oc.hpp.
|
inline |
Definition at line 301 of file sys-vm-oc.hpp.
|
inline |
validate an in-wasm-memory char array that must be null terminated
Definition at line 92 of file sys-vm-oc.hpp.
void sysio::chain::webassembly::eosvmoc::register_eosvm_oc | ( | Name | n | ) |
Definition at line 383 of file sys-vm-oc.hpp.
|
constexpr |
Definition at line 183 of file sys-vm-oc.hpp.
|
constexpr |
Definition at line 156 of file sys-vm-oc.hpp.