-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return nop arity #82
Comments
Are you suggesting that the arity is 0 but still include the If you mean arity 0 without the |
Well right now, in the baseline for this module there's
Which is wrong because this is a spec test, meaning the sexpr is valid, but d8 thinks it's wrong. From what I see, the function signature returns void, therefore, the return opcode should have arity 0. After further investigation, I realized that this is not a problem with nop in particular, but with the fact that sexpr-wasm determines the arity of the return opcode if there's an expression next to it. By reading the spec for the return opcode, looking at the v8's and chakra's implementation of the return opcode. The arity means, how many values to return. If the return type is void, the arity should be 0 regardless of what the sexpr "looks" like. |
I'm not sure that's right, see the PR that added explicit arities here: WebAssembly/design#595
|
Well from what you've quoted it sounds like we need the arity and the functions type to match so that tools don't need to know about the function type. I feel that it is valid to give a validation error if the arity doesn't match the type like v8 @rossberg-chromium What do you think ? |
This is no longer needed as we are removing arities from return op. WebAssembly/design#741 |
For the following function
(func $return-nop (return (nop)))
(https://github.com/WebAssembly/testsuite/blob/master/functions.wast)There is a conflict between the function type and return arity.
The type of the function is
And the function body is the following
Since
nop
is: an empty operator that does not yield a valuethen the arity of the return statement should be 0 thus having a valid type.
I found this by running the tests, I am surprised this didn't come up in the CI
The text was updated successfully, but these errors were encountered: