Open
Description
Describe the Bug
wasm-bindgen's interpreter chokes on emscripten compiled code. I'm running into this specifically when trying to use FMOD's HTML5 build and using the currently unstable -Zwasm-c-abi=spec
flag
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] arguments []
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] starting a call of Id { idx: 26 } Some("__wasm_call_ctors")
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] arguments []
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] starting a call of Id { idx: 1511 } Some("_GLOBAL__sub_I_fmod_bankmodel.cpp")
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] arguments []
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] starting a call of Id { idx: 1399 } Some("_ZN4FMOD16RuntimeBankModelC2Ev")
[2025-04-28T06:26:40Z DEBUG wasm_bindgen_wasm_interpreter] arguments [32768]
thread 'main' panicked at crates/wasm-interpreter/src/lib.rs:245:21:
_ZN4FMOD16RuntimeBankModelC2Ev: non-i32 constant
I'm suspicious of that argument count- [32768]
looks to me like a magic value for vaargs
Steps to Reproduce
- Clone https://github.com/melody-rs/fmod-oxide
- Download FMOD's HTML5 build, and place it in
fmod-sys/fmod
(fmod-oxide's README goes into more detail) - Run
RUSTFLAGS="-Zwasm-c-abi=spec" cargo build -p wasm-unknown --target wasm32-unknown-unknown
- Run
RUST_LOG=debug wasm-bindgen target/wasm32-unknown-unknown/debug/wasm_unknown.wasm --out-dir out