From e4c7fc58a54d8ca25db92846f09c089bc58e1f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 19 Oct 2026 08:12:57 +0200 Subject: [PATCH] compiler: fix ptrAbiAlignment() for esoteric targets This should really just ask for the integer alignment of the pointer bit width, thus avoiding the target-specific special cases we'd otherwise have to insert here, e.g. for avr and spork8 in addition to ez80. --- src/Type.zig | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Type.zig b/src/Type.zig index 2c207738b8f55cae37a5a120b68d968fa51e1f66..7a4256263882de8fe68ec8331e256b3dabd53db8 100644 --- a/src/Type.zig +++ b/src/Type.zig @@ -1302,10 +1302,7 @@ pub fn abiSize(ty: Type, zcu: *const Zcu) u64 { } pub fn ptrAbiAlignment(target: *const Target) Alignment { - // The eZ80 has 24-bit pointers, which aren't exact powers of two, tripping - // the assert. The alignment of eZ80 pointers is 1, so we bypass the check. - if (target.cpu.arch == .ez80) return .@"1"; - return .fromNonzeroByteUnits(@divExact(target.ptrBitWidth(), 8)); + return .fromNonzeroByteUnits(std.zig.target.intAlignment(target, target.ptrBitWidth())); } pub fn ptrAbiSize(target: *const Target) u64 { return @divExact(target.ptrBitWidth(), 8); -- 2.54.0