Bug 266167 - [Wasm-GC] Fix returned reference in br_on_null in LLInt/B3
Summary: [Wasm-GC] Fix returned reference in br_on_null in LLInt/B3
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 247394
  Show dependency treegraph
 
Reported: 2023-12-09 23:01 PST by Asumu Takikawa
Modified: 2023-12-12 19:50 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Asumu Takikawa 2023-12-09 23:01:22 PST
The following test case using `br_on_null` crashes on some tiers:

```
//@ runWebAssemblySuite("--useWebAssemblyTypedFunctionReferences=true", "--useWebAssemblyGC=true")

import * as assert from "../assert.js";
import { compile, instantiate } from "./wast-wrapper.js";

instantiate(`
(module
  (type (struct (field i32)))
  (func (export "f")
    (block
      (struct.new 0 (i32.const 42))
      (br_on_null 0)
      (struct.get 0 0)
      drop
      ))
)
`).exports.f();
```

It works fine in BBQJIT, but seems to have issues in LLInt (possibly OMG). The problem is the returned reference on a non-taken branch case is not handled quite right.
Comment 1 Asumu Takikawa 2023-12-12 10:46:57 PST
Pull request: https://github.com/WebKit/WebKit/pull/21692
Comment 2 EWS 2023-12-12 19:48:47 PST
Committed 271964@main (4c063193fca3): <https://commits.webkit.org/271964@main>

Reviewed commits have been landed. Closing PR #21692 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-12-12 19:50:12 PST
<rdar://problem/119590935>