-
Notifications
You must be signed in to change notification settings - Fork 245
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
wasm-parser: should typed select parse with result arity ≠ 1? #870
Comments
From the commit referenced it looks like the binary representation of all of the I suspect there may be an issue parsing |
Nope, parsing the text actually works okay (or at least The way I have this set up is that I take
I haven’t looked into this but I believe in either case the first of the selects ends up being encoded as I should actually look into what makes the interpreter stomach these functions fine. I’m still not sure whether this passes the interpreter’s validator (and if so – whether than has anything to do with the It might also be the case that |
You can inspect a bit with
so you're right it's popping out as |
Previously multiple `(result)` blocks would erroneously discard the previously parsed result blocks, so this commit fixes the textual parsing of this instruction to collect all of the `(result)` blocks instead of only the final one. Closes bytecodealliance#870
Previously multiple `(result)` blocks would erroneously discard the previously parsed result blocks, so this commit fixes the textual parsing of this instruction to collect all of the `(result)` blocks instead of only the final one. Closes bytecodealliance#870
Previously multiple `(result)` blocks would erroneously discard the previously parsed result blocks, so this commit fixes the textual parsing of this instruction to collect all of the `(result)` blocks instead of only the final one. Closes #870
In the webassembly specification
select
with any number of result types is allowed by the binary representation, and is rejected in validation rather than the binary encoding.wasmparser::VisitOperator
instead models this kind of instruction asvisit_typed_select
with a single result argument, and therefore is forced to reject this encoding earlier, while decoding the binary representation:wasm-tools/crates/wasmparser/src/binary_reader.rs
Lines 785 to 794 in b6233ed
In particular WebAssembly/spec@ef01de5 has added tests that do successfully parse (and, I think, validate? Not sure.) which triggers this condition in wasmparser.
Should
wasmparser
pass this test? Should we allow decoding (and encoding) typed selects with result arity ≠ 1?The text was updated successfully, but these errors were encountered: