Bug 270374
| Summary: | [Wasm-GC] Fix JS API casts for some top types | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Asumu Takikawa <asumu> |
| Component: | WebAssembly | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Asumu Takikawa
Pull request: https://github.com/WebKit/WebKit/pull/25599
Radar WebKit Bug Importer
<rdar://problem/124294503>
EWS
Committed 276580@main (a2bcc4921f7c): <https://commits.webkit.org/276580@main>
Reviewed commits have been landed. Closing PR #25599 and removing active labels.