wasm-bindgen >= 0.2.94 generates undesired table.fill
instructions when used with rust 1.82.0
#4250
Labels
table.fill
instructions when used with rust 1.82.0
#4250
Describe the Bug
When using rust 1.82.0 and wasm-bindgen 0.2.94 or 0.2.95, builds fail because the wasm-bindgen output includes
table.fill
instructions that are poorly supported by downstream tools (namely, Trunk).Steps to Reproduce
Reproducible two ways:
With Trunk 0.21.2 and rust 1.82.0:
trunk build --release
Or, using rust 1.82.0, wasm-bindgen 0.2.95, and wasm-opt v116:
cargo build --target=wasm32-unknown-unknown --release --bin wasm_test_2024
wasm-bindgen --target=web --out-dir=target/wasm-bindgen/release --out-name=wasm_test_2024 target/wasm32-unknown-unknown/release/wasm_test_2024.wasm --no-typescript
wasm-opt -Oz target/wasm-bindgen/release/wasm_test_2024_bg.wasm --output wasm-opt.out
The failure can't be reproduced with rust 1.81.0.
Expected Behavior
No
table.fill
instructions.Trunk's bundled
wasm-opt
can't handle them (and doesn't yet support the CLI changes needed to enable bulk-memory in wasm-opt >= v117).Actual Behavior
wasm-opt
(version 116, as bundled by Trunk) fails with:I am informed that this means that
wasm-bindgen
emittedtable.fill
instructions.Additional Context
I expect this is a duplicate issue, because the
wasm-bindgen
main branch seems to work, presumably because #4237 solved this? (the changlelog entry says Only emittable.fill
instructions if the bulk-memory proposal is enabled.)I wanted to write this up anyway because I didn't see my failure symptom described in any current issues, and wanted to ensure that I was correctly understanding the problem and its solution (can we get the fix in a new release?)
(Related issue in Trunk repo)
The text was updated successfully, but these errors were encountered: