You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This test case should fail validation with type mismatch: expression has type (ref any) but expected eqref. FWIW, Firefox, wasmparser, and the reference interpreter all give that validation error, however binaryen incorrectly claims it is valid.
The br_on_cast should be typed [externref eqref] -> [externref (ref any)] because diff(anyref, arrayref) = (ref any), but it seems like binaryen is typing it as an identity function.
This is likely due to br_on_* not supporting a sent value in addition to the reference itself, which is a current limitation. No real-world code so far does that AFAIK so it has not been a priority to add (and due to it requiring multivalue it has downsides in our IR).
Separately it is odd that this does not fail to validate on the br_on_cast going to a multivalue block. That suggests we are also missing validation there. We only fuzz valid testcases so that was missed I supposed. Adding that validation should be simple.
FWIW we do report a validation error when parsing this wat directly with --new-wat-parser due to the sent type of br_on_cast not matching the target block type. I assume the original repro was parsed from binary instead; perhaps our binary parser is doing something odd that masks the problem.
Originally reported as WebAssembly/gc#510
This test case should fail validation with
type mismatch: expression has type (ref any) but expected eqref
. FWIW, Firefox,wasmparser
, and the reference interpreter all give that validation error, however binaryen incorrectly claims it is valid.The
br_on_cast
should be typed[externref eqref] -> [externref (ref any)]
becausediff(anyref, arrayref) = (ref any)
, but it seems like binaryen is typing it as an identity function.The text was updated successfully, but these errors were encountered: