-
Notifications
You must be signed in to change notification settings - Fork 460
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
The definition of validation of br_table is inadequate #1708
Comments
That is the type in the j-th position, i.e., 𝑡_𝑗 and 𝑡'_𝑖𝑗 are in the same position in their respective vectors. That wording is used in other places of the spec as well. I suppose it is unclear here due to the missing precondition that 𝑡* and C.labels[𝑙_𝑖] have the same length. Please see #1709 for a fix. |
Just to unpack this a little more, instead of "all labels have the same type" it would be more precise to say "all labels are supertypes of the current stack type" - the reason that the linked test validates is because in unreachable code, there's a conceptual "bottom" type which is a subtype of both In particular the following wouldn't validate:
|
Thank you! |
The spec defines the validation of br_table as follows and I think this definition is inadequate.
When I first saw this definition, I took it to mean "all labels have the same type". However, I realised my mistake when I saw the following test in unreached-valid.wast.
https://github.com/WebAssembly/spec/blob/main/test/core/unreached-valid.wast#L49
In my first interpretation, this module is invalid because [f32] and [f64] are not the same.
In order for this module to be valid, t* must be something like [f32 f64].
The problem is that it is unclear what is intended by "corresponding" in the spec.
The text was updated successfully, but these errors were encountered: