Bug 270374

Summary: [Wasm-GC] Fix JS API casts for some top types
Product: WebKit Reporter: Asumu Takikawa <asumu>
Component: WebAssemblyAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 247394    

Asumu Takikawa
Reported 2024-03-01 13:36:45 PST
There are a small number of cases in the JS API cast code that makes too-optimistic assumptions for top types (because the code was originally written to implement cast instructions, which benefit from static type-checking). Example diff for js-api.js: ``` + { + let m1 = instantiate(` + (module + (func (export "f")) + ) + `); + assert.throws( + () => instantiate(` + (module + (global (import "m" "f") (ref any)) + ) + `, { m: { f: m1.exports.f } }), + WebAssembly.LinkError, + "Argument value did not match the reference type" + ) + } ``` There's a simple fix for these cases.
Attachments
Asumu Takikawa
Comment 1 2024-03-07 15:32:32 PST
Radar WebKit Bug Importer
Comment 2 2024-03-08 13:37:12 PST
EWS
Comment 3 2024-03-22 16:53:59 PDT
Committed 276580@main (a2bcc4921f7c): <https://commits.webkit.org/276580@main> Reviewed commits have been landed. Closing PR #25599 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.