Open rootbeer opened 1 month ago
Poking at this a bit more, it seems the problem is greater-than-32-bit fields of the packed struct. So replacing the T
declaration with:
const T = packed struct(u64) {
a: u32 = 0,
b: u32 = 0,
};
works fine, but shifting to:
const T = packed struct(u64) {
a: u31 = 0,
b: u33 = 0,
};
Triggers the error.
The error is basically the same on wasm v10.0.2 as on v23.0.1, too.
Zig Version
0.14.0-dev.878+c6995e6de
Steps to Reproduce and Observed Behavior
The following main.zig compiles and runs just fine on my default target (x86_64 linux):
working version:
But if I compile and run this on wasm the compile succeeds, but wasmtime fails to run it:
It looks like fmt has caused a similar problem in the past (#15609) but I think the details are different in this time, so I filed a new bug.
Dropping the
packed
or reducing theu64
tou32
avoids the problem.Some additional details:
wasm-decompile doesn't like it either:
Expected Behavior
wasm target should work like the native target