diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-10-28 08:27:07 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-10-29 06:20:52 -0700 |
| commit | 1553c8eae7d830cb793e78c3e52ad816fa8efd23 (patch) | |
| tree | be57dc6fec4657151520de9a8613a983b4b7e629 /lib/std | |
| parent | 030b630829d3fe9c6c387a9bf68ae65ddb3b053c (diff) | |
| download | zig-1553c8eae7d830cb793e78c3e52ad816fa8efd23.tar.gz zig-1553c8eae7d830cb793e78c3e52ad816fa8efd23.zip | |
std.os.linux.x86: fix signal restore function
After handling any signal on x86, it would previously segfault.
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/os/linux/x86.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/std/os/linux/x86.zig b/lib/std/os/linux/x86.zig index 3770607f55..a68a4af317 100644 --- a/lib/std/os/linux/x86.zig +++ b/lib/std/os/linux/x86.zig @@ -159,12 +159,14 @@ pub fn clone() callconv(.naked) u32 { pub fn restore() callconv(.naked) noreturn { switch (builtin.zig_backend) { .stage2_c => asm volatile ( + \\ addl $4, %%esp \\ movl %[number], %%eax \\ int $0x80 : : [number] "i" (@intFromEnum(SYS.sigreturn)), ), else => asm volatile ( + \\ addl $4, %%esp \\ int $0x80 : : [number] "{eax}" (@intFromEnum(SYS.sigreturn)), |
