authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-01-31 07:09:19+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-01-31 07:09:19+01:00
logda95409f3159a623b42aae5ff4bedd965f14e836
tree485d4ecaee4afcb248f02de2f98e1848ee473212
parentc7c4e8d802c5c8ab2dc9d064c3985836e6677115
parent7c68ab1d1085925ec33dc0f8a6695006b2d7a85d

Merge pull request '`llvm`: handle `packed struct`s in C ABI integer promotion' (#31062) from alexrp/zig:packed-struct-cconv-fix into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31062

3 files changed, 3 insertions(+), 2 deletions(-)

lib/std/Io/Threaded.zig+1
......@@ -16796,6 +16796,7 @@ fn createFileMap(
1679616796 .OVERFLOW => return error.Unseekable,
1679716797 .BADF => return errnoBug(err), // Always a race condition.
1679816798 .INVAL => return errnoBug(err), // Invalid parameters to mmap()
16799 .OPNOTSUPP => return errnoBug(err), // Bad flags with MAP.SHARED_VALIDATE on Linux.
1679916800 else => return posix.unexpectedErrno(err),
1680016801 }
1680116802 };
lib/std/os/linux.zig+1
......@@ -146,6 +146,7 @@ pub const MAP_TYPE = enum(u4) {
146146 SHARED = 0x01,
147147 PRIVATE = 0x02,
148148 SHARED_VALIDATE = 0x03,
149 DROPPABLE = 0x08,
149150};
150151
151152pub const MAP = switch (native_arch) {
src/codegen/llvm.zig+1-2
......@@ -12608,8 +12608,7 @@ fn ccAbiPromoteInt(cc: std.builtin.CallingConvention, zcu: *Zcu, ty: Type) ?std.
1260812608 }
1260912609 const int_info = switch (ty.zigTypeTag(zcu)) {
1261012610 .bool => Type.u1.intInfo(zcu),
12611 .int, .@"enum", .error_set => ty.intInfo(zcu),
12612 else => return null,
12611 else => if (ty.isAbiInt(zcu)) ty.intInfo(zcu) else return null,
1261312612 };
1261412613 return switch (target.os.tag) {
1261512614 .driverkit, .ios, .maccatalyst, .macos, .watchos, .tvos, .visionos => switch (int_info.bits) {