strange memory layout for enums with repr in webassembly #76916
Labels
A-layout
Area: Memory layout of types
C-bug
Category: This is a bug.
O-wasm
Target: WASM (WebAssembly), http://webassembly.org/
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
and compiled it with
-C opt-level=3 --target wasm32-unknown-unknown
https://godbolt.org/z/cTqbMqI expected to see this happen: The code should be the same for
test_direct
andtest_indirect
. It should push two i32 values: 1 and 4096.Instead, this happened:
test_indirect
pushes 8 values instead of two: 1, 0, 0, 0, 255, 15, 0 and 0. The numbers pushed seem to depend on the bitsize of the repr meaning only 4 values get pushed for repr(u16)The text was updated successfully, but these errors were encountered: