Bug 251133
Summary: | [Wasm-GC] Fix null checks for struct operations | ||
---|---|---|---|
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's a bug in the implementation of Wasm GC struct instructions such as `struct.get` and `struct.set`, in that they don't correctly implement null ref checks.
Here's an example test case (can run in the JSTests/wasm/gc test directory):
```
import * as assert from "../assert.js";
import { compile, instantiate } from "./wast-wrapper.js";
let m = instantiate(`
(module
(type (struct (field i32)))
(func (export "f") (result i32)
(struct.get 0 0 (ref.null 0)))
)
`);
m.exports.f();
```
This currently crashes, instead of raising a trap exception as needed.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Asumu Takikawa
Pull request: https://github.com/WebKit/WebKit/pull/9091
EWS
Committed 259449@main (a5a87681d68f): <https://commits.webkit.org/259449@main>
Reviewed commits have been landed. Closing PR #9091 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/104707623>