Bug 266167

Summary: [Wasm-GC] Fix returned reference in br_on_null in LLInt/B3
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    

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>