wasm-micro-runtime icon indicating copy to clipboard operation
wasm-micro-runtime copied to clipboard

support multi-value from host

Open GaZaTu opened this issue 1 year ago • 0 comments

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.

grafik 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

GaZaTu avatar Jul 31 '24 09:07 GaZaTu