wasm3 / wasm3-rs

Rust wrapper for Wasm3, the fastest WebAssembly interpreter
MIT License
160 stars 44 forks source link

Fix wrong WasmType::TYPE_INDEX value for the () type #3

Closed wildbook closed 4 years ago

wildbook commented 4 years ago

TYPE_INDEX for the unit type should be c_m3Type_none instead of c_m3Type_void since WASM spec does not define void as a valid type.

There is also a comment about this in wasm3, although it's well hidden: https://github.com/wasm3/wasm3/blob/f75f647c61abc2abdd212ac6f34b026d48818a0f/source/m3_bind.c#L69

This PR fixes this, making it possible to call WASM functions that do not return a value.