Description
Describe the Bug
We compile two wasm modules, one with target features for bulk-memory, simd128, nontrapping-fptoint, sign-ext, and reference-types and one without those target features. The one without those target features no longer works on Safari 15 and below. I suspect that may be caused by the combination of https://releases.rs/docs/1.82.0/#compatibility-notes (The WebAssembly target features multivalue
and reference-types
are now both enabled by default) and https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md#changed-2 ("Implicitly enable reference type and multivalue transformations if the module already makes use of the corresponding target features"), though it could be an unrelated issue. We'd like to try to generate a vanilla module like the one we created before, with those transformations disabled, but the Rust upgrade notes say "Generating a WebAssembly module that disables default features requires -Zbuild-std
support from Cargo", and looking at https://doc.rust-lang.org/cargo/reference/unstable.html#build-std, that's still an unstable feature, so I looked to wasm-bindgen for a way to at least disable the transformation but I don't see one.
This is the script that builds the WASM modules: https://github.com/ruffle-rs/ruffle/blob/master/web/packages/core/tools/build_wasm.ts
This is the code that determines which module to load: https://github.com/ruffle-rs/ruffle/blob/master/web/packages/core/src/load-ruffle.ts#L38-L52
Steps to Reproduce
- Go to https://ruffle.rs/demo/ with Safari 15
- The error reported by someone using that browser says
RuntimeError: Out of bounds table access (evaluating 'b._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h281f2f93d3d6cf28(n,e,t)')
Expected Behavior
The vanilla WASM module that loads should work on browsers without WebAssembly extensions.
Actual Behavior
The application panics.