diff --git a/src/ir/type_bridge.zig b/src/ir/type_bridge.zig index dfbea28..64e4531 100644 --- a/src/ir/type_bridge.zig +++ b/src/ir/type_bridge.zig @@ -79,14 +79,16 @@ pub fn bridgeType(ty: sx_types.Type, table: *TypeTable) TypeId { 16 => .s16, 32 => .s32, 64 => .s64, - else => .s64, + // Non-standard width: intern the exact width rather than quantising + // to s64 (which would silently change the type's size). + else => table.intern(.{ .signed = w }), }, .unsigned => |w| switch (w) { 8 => .u8, 16 => .u16, 32 => .u32, 64 => .u64, - else => .u64, + else => table.intern(.{ .unsigned = w }), }, .f32 => .f32, .f64 => .f64,