wasm-micro-runtime
wasm-micro-runtime copied to clipboard
support multi-value from host
Feature
multi-value currently only works from wasm to host but should also work from host to wasm.
Example
NativeSymbol NATIVES[] = {
{ "wasm_return_tuple", (void*)&wasm_return_tuple, "()II", nullptr },
};
wasm_runtime_register_natives_raw("env", NATIVES, 1);
=> Error: failed to check signature '()II' and resolve pointer params for import function (env wasm_return_tuple)
This error occurs because the parameter WASMFuncType* type in check_symbol_signature incorrectly specifies "~" in types.
inspected type parameter
(module
(func $wasm_return_tuple (import "env" "wasm_return_tuple") (result i64 i64))
(func $wasm_main (export "wasm_main") (result i64 i64)
(call $wasm_return_tuple)
)
)
test.wat