RESOLVED FIXED260039
[Wasm-GC] Module linking should take subtyping into account
https://bugs.webkit.org/show_bug.cgi?id=260039
Summary [Wasm-GC] Module linking should take subtyping into account
Asumu Takikawa
Reported 2023-08-10 13:58:01 PDT
Right now, module linking checks for exact type index equality to make sure linked functions satisfy their types. The GC proposal extends this to work with subtypes, instead of exact match, but this isn't implemented yet. For example, this test fragment is from the GC proposal repo test suite: ``` (module (type $t0 (sub (func (result (ref null func))))) (rec (type $t1 (sub $t0 (func (result (ref null $t1)))))) (rec (type $t2 (sub $t1 (func (result (ref null $t2)))))) (func (export "f0") (type $t0) (ref.null func)) (func (export "f1") (type $t1) (ref.null $t1)) (func (export "f2") (type $t2) (ref.null $t2)) ) (register "M") (module (type $t0 (sub (func (result (ref null func))))) (rec (type $t1 (sub $t0 (func (result (ref null $t1)))))) (rec (type $t2 (sub $t1 (func (result (ref null $t2)))))) (func (import "M" "f0") (type $t0)) (func (import "M" "f1") (type $t0)) (func (import "M" "f1") (type $t1)) (func (import "M" "f2") (type $t0)) (func (import "M" "f2") (type $t1)) (func (import "M" "f2") (type $t2)) ) ``` The import "f1" takes a function that has type `$t1` (subtype of `$t0`) and tries to import it under type `$t0`. This currently fails, but is supposed to succeed. It should be relatively easy to fix, by changing the index equality check to a `isSubtype` call.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-08-17 13:58:15 PDT
Asumu Takikawa
Comment 2 2023-12-15 10:28:12 PST
EWS
Comment 3 2023-12-18 09:55:06 PST
Committed 272226@main (3015bbe0e8ab): <https://commits.webkit.org/272226@main> Reviewed commits have been landed. Closing PR #21875 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.