Commit cfa247e53b

Jacob Young <jacobly0@users.noreply.github.com>
2023-10-17 07:13:55
x86_64: fix C abi argument passing in memory
1 parent 877393d
Changed files (1)
src
arch
src/arch/x86_64/CodeGen.zig
@@ -13755,7 +13755,8 @@ fn resolveCallingConventionValues(
                 }
 
                 const param_size: u31 = @intCast(ty.abiSize(mod));
-                const param_align: u31 = @intCast(ty.abiAlignment(mod).toByteUnitsOptional().?);
+                const param_align: u31 =
+                    @intCast(@max(ty.abiAlignment(mod).toByteUnitsOptional().?, 8));
                 result.stack_byte_count =
                     mem.alignForward(u31, result.stack_byte_count, param_align);
                 arg.* = .{ .load_frame = .{