-
Notifications
You must be signed in to change notification settings - Fork 74
Description
In LLVM 19 the reference-types
feature is being enabled by default in llvm/llvm-project#96584. This is having consequences in Rust - rust-lang/rust#128475 - and is requiring documentation to be written - rust-lang/rust#128511 - for how to disable features (docs that should be written anyway, but this update is becoming a strong forcing function).
The main consequence of enabling reference-types
is that the table index immediate in the call_indirect
instruction is now being encoded as an overlong uleb which is 5 bytes long as 80 80 80 80 00
. This overlong encoding of 0 has no semantic difference from when reference-types
were disabled but validators and parsers which don't support reference types are rejecting these modules.
I wanted to raise this issue here for awareness to confirm that this is expected fallout. I understand that enabling refernece-types
by default is expected, but I wanted to additionally confirm that the consequences of actually emitting a breaking change into all modules using call_indirect
relative to parsers that don't support reference-types
is expected. This seems like surprising behavior to me where modules that don't use reference-types
at all are now required to be executed in runtimes that support the reference-types
proposal.
Or, alternatively, if there's an easy-ish way to shrink the leb encoding here (e.g. by assuming there's <= 127 tables and continuing to use a single byte) I think that'd personally be best to generate MVP modules as much as possible and only emit newer features when explicitly requested.