Commit bf28a47cf2

Luuk de Gram <luuk@degram.dev>
2022-07-14 19:48:42
wasm: pass correct abi-size for scalar values
When returning an aggregate type that contains a scalar value (nested), its abi-size is passed by bits, rather than bytes to `buildOpcode`.
1 parent 7c13bdb
Changed files (1)
src
arch
src/arch/wasm/CodeGen.zig
@@ -1674,7 +1674,7 @@ fn airRet(self: *Self, inst: Air.Inst.Index) InnerError!WValue {
                 try self.emitWValue(operand);
                 const opcode = buildOpcode(.{
                     .op = .load,
-                    .width = @intCast(u8, scalar_type.abiSize(self.target)),
+                    .width = @intCast(u8, scalar_type.abiSize(self.target) * 8),
                     .signedness = if (scalar_type.isSignedInt()) .signed else .unsigned,
                     .valtype1 = typeToValtype(scalar_type, self.target),
                 });