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`.
This commit is contained in:
Luuk de Gram
2022-07-14 19:48:42 +02:00
parent 7c13bdb1c9
commit bf28a47cf2

View File

@@ -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),
});