aboutsummaryrefslogtreecommitdiff
path: root/src/arch/wasm/CodeGen.zig
diff options
context:
space:
mode:
authorLuuk de Gram <luuk@degram.dev>2022-07-14 19:48:42 +0200
committerLuuk de Gram <luuk@degram.dev>2022-07-25 06:33:56 +0200
commitbf28a47cf23a60539f7cc6cb87309d1a7fa01c18 (patch)
tree9330aed65b14acc2215d9c670d3687555d0193da /src/arch/wasm/CodeGen.zig
parent7c13bdb1c9c7f61def9b58b1f24072a4eddc54c1 (diff)
downloadzig-bf28a47cf23a60539f7cc6cb87309d1a7fa01c18.tar.gz
zig-bf28a47cf23a60539f7cc6cb87309d1a7fa01c18.zip
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`.
Diffstat (limited to 'src/arch/wasm/CodeGen.zig')
-rw-r--r--src/arch/wasm/CodeGen.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
index ab73e23783..1fbf9f5785 100644
--- a/src/arch/wasm/CodeGen.zig
+++ b/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),
});