84 {
87 try {
89
91
93 for(std::uint32_t i = 0; i < imports.size(); ++i) {
94 SYS_ASSERT(std::string_view((
char*)imports[i].module_str.raw(), imports[i].module_str.size()) ==
"env" &&
95 is_intrinsic_whitelisted(intrinsics, std::string_view((
char*)imports[i].field_str.raw(), imports[i].field_str.size())),
96 wasm_serialization_error, "${module}.${fn} unresolveable",
97 ("module", std::string((char*)imports[i].module_str.raw(), imports[i].module_str.size()))
98 ("fn", std::string((char*)imports[i].field_str.raw(), imports[i].field_str.size())));
99 }
100
102 SYS_ASSERT(apply_idx < std::numeric_limits<uint32_t>::max(), wasm_serialization_error,
"apply not exported");
105 } catch(vm::exception& e) {
106 SYS_THROW(wasm_serialization_error, e.detail());
107 }
108}
#define SYS_THROW(exc_type, FORMAT,...)
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
backend_t bkend(hello_wasm, ehm, &wa)
bool is_intrinsic_whitelisted(const whitelisted_intrinsics_type &whitelisted_intrinsics, std::string_view name)
std::uint32_t max_module_bytes
uint32_t get_exported_function(const std::string_view str)
guarded_vector< import_entry > imports
auto & get_function_type(uint32_t index) const