wasmerio / wasmer-ruby

💎🕸 WebAssembly runtime for Ruby
https://wasmer.io
MIT License
465 stars 18 forks source link

Integer conversion raising en exception #62

Open ljulliar opened 2 years ago

ljulliar commented 2 years ago

When trying to call an exported WASM function from Ruby with a negative integer parameter an exception is raised.

The function call is: @exports.i32_to_s.call(-1) the parameter signature of the WASM func is i32

and the exception raised is TypeError: out of range integral type conversion attempted

I have no trouble passing a positive value. Is this the expected behavior ? How can I pass a negative value ? Do i Have to pass the 2-complement positive value (meaning 65535 here) ?

Thank you for your help.