wasmer-ruby icon indicating copy to clipboard operation
wasmer-ruby copied to clipboard

Integer conversion raising en exception

Open ljulliar opened this issue 3 years ago • 0 comments

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.

ljulliar avatar Jun 01 '22 16:06 ljulliar