Description
An initializer expression is very similar to a function body just with a much more restricted set of allowed instructions.
For function bodys we have a limit of 7,654,321 bytes
each. [spec]
I'd argue that we should therefore also introduce at least the same limit to constant initializer expressions (or a smaller limit)?
Given the generous limit this shouldn't be breaking anybody (wasm-gc is probably right now the only feature where initializer expressions could get somewhat large if e.g. a global defines an object with deeply nested objects and arrays).
Context: Our init-expression fuzzer in V8 generated some deeply nested structs with non-nullable references and then decided to generate an ~8MB initializer expression to populate a struct of that type. The fuzzer compares the result against running a function with the same body as the initializer expression expecting that we produce an equivalent object but ran into this limit on the function body after successfully decoding and accepting the huge initializer expression.