Bug 260542

Summary: Wasm element segment vector items should allow more constant expressions
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-08-22 14:12:43 PDT
Right now a Wasm module element segment's initialization vector can only contain either `ref.func` or `ref.null`.

This fails for test examples such as the following from the extended const proposal repo:

https://github.com/WebAssembly/extended-const/blob/7612271a72f00e2b385a98a7f79a031f94fb77e6/test/core/elem.wast#L680

(this particular test doesn't actually depend on extended constant expressions, it should parse in current Wasm)

The Wasm spec allows `global.get` to appear in the element vector:

  https://webassembly.github.io/spec/core/valid/instructions.html#constant-expressions

In the future, there will be other kinds of elements that will be legal with the GC proposal.
Comment 1 Radar WebKit Bug Importer 2023-08-29 14:13:16 PDT
<rdar://problem/114659364>
Comment 2 Asumu Takikawa 2023-12-13 13:26:03 PST
Pull request: https://github.com/WebKit/WebKit/pull/21755
Comment 3 EWS 2024-01-12 17:59:00 PST
Committed 273002@main (f546b9fda023): <https://commits.webkit.org/273002@main>

Reviewed commits have been landed. Closing PR #21755 and removing active labels.