Broken WASM codegen with u128 and wasm_abi #88207
Labels
A-ABI
Area: Concerning the application binary interface (ABI)
A-FFI
Area: Foreign function interface (FFI)
A-LTO
Area: Link-time optimization (LTO)
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
O-wasm
Target: WASM (WebAssembly), http://webassembly.org/
It seems that the following code:
can result in invalid WASM being generated in case it is compiled with
lto = true
. I've created a repository with the minimal example that reproduces the issue when built with (tested onrustc 1.56.0-nightly (0035d9dce 2021-08-16)
):Parsing the generated WASM will produce an error similar to the following:
Using an argument of type
u64
or disablinglto
or using the C ABI instead of wasm ABI (which enables LLVM's multivalue feature) works.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: