From c60a3bbdc11c10d4ee60e42d198ab11d8da03265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 14 Sep 2026 23:38:02 +0200 Subject: [PATCH] std.os.windows: use the peb() cbe workaround for all architectures like teb() --- lib/std/os/windows.zig | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig index d7b4c61331b1d30eab3255183ca376a65a5f340c..0f6eaae0122b2dc59d2dcc1d0cd40a262686938b 100644 --- a/lib/std/os/windows.zig +++ b/lib/std/os/windows.zig @@ -3645,14 +3645,12 @@ pub fn teb() *TEB { } pub fn peb() *PEB { - if (builtin.zig_backend == .stage2_c) switch (native_arch) { - .x86, .x86_64 => return @ptrCast(@alignCast(struct { - /// This is a workaround for the C backend until zig has the ability to put - /// C code in inline assembly. - extern fn zig_windows_peb() callconv(.c) *anyopaque; - }.zig_windows_peb())), - else => {}, - } else switch (native_arch) { + if (builtin.zig_backend == .stage2_c) return @ptrCast(@alignCast(struct { + /// This is a workaround for the C backend until zig has the ability to put + /// C code in inline assembly. + extern fn zig_windows_peb() callconv(.c) *anyopaque; + }.zig_windows_peb())); + switch (native_arch) { .aarch64 => { comptime assert(@offsetOf(TEB, "ProcessEnvironmentBlock") == 0x60); return asm ( -- 2.54.0