WebAssembly / spec

WebAssembly specification, reference interpreter, and test suite.
https://webassembly.github.io/spec/
Other
3.13k stars 445 forks source link

Remove failure case with ambiguous error options #1729

Closed rvagg closed 7 months ago

rvagg commented 7 months ago

This failure case could be equally valid as "type mismatch" if a validator is validating one opcode at a time rather than consuming them all then validating the return type.

It wants a ref.func but the first opcode it finds is an i32.const so a streaming validator should be able to error on the first opcode rather than wait for more to decide that it's not a constant expression.

I can't think of an alternative to replace this with, so I'm suggesting this case is unnecessary and too ambiguous.