-
Notifications
You must be signed in to change notification settings - Fork 745
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
Validator: Check subtyping in CallIndirect [DO NOT LAND] #6336
Conversation
(found by fuzzing with #6327) |
Sounds like there is a V8 bug here. The validation rule for The V8 error message here is extra interesting because it implies that V8 will also disallow |
I have a PR up adding spec tests for this: WebAssembly/gc#526 |
Sounds like we'll have to update V8's implementation there, yes. |
V8-side fix in flight: crrev.com/c/5319505 |
As discovered on WebAssembly/binaryen#6336, we erroneously required that the immediate type of a call_indirect instruction be a subtype of the referenced table's type, but there is no such requirement in the spec. This patch drops the check. This change is backwards-compatible because it makes V8's behavior strictly more permissive. Bug: v8:9495 Change-Id: I198822e3d1ef8d8dd349fa92ed9e49d043d5d192 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5319505 Commit-Queue: Manos Koukoutos <[email protected]> Commit-Queue: Jakob Kummerow <[email protected]> Reviewed-by: Manos Koukoutos <[email protected]> Auto-Submit: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#92509}
Great, thanks @jakobkummerow , let's close this PR then. |
V8 requires this, e.g.
errors on
However, @tlively you wrote otherwise in a test, so I am confused:
binaryen/test/lit/passes/unsubtyping.wast
Lines 525 to 536 in f6bb943
Reading the main spec, it still mentions only funcref, so it is pre-typed-function-references I guess. Reading the typed function references spec I only see it change the requirement from
funcref
toref null func
. I also cannot find anything in the overviews, so I am lost as to what the correct behavior is.cc @jakobkummerow for the V8 behavior - am I reading that error right, and if so where in the spec is that validation rule added?