authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-28 08:27:07-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-29 06:20:52-07:00
log1553c8eae7d830cb793e78c3e52ad816fa8efd23
treebe57dc6fec4657151520de9a8613a983b4b7e629
parent030b630829d3fe9c6c387a9bf68ae65ddb3b053c

std.os.linux.x86: fix signal restore function

After handling any signal on x86, it would previously segfault.

1 files changed, 2 insertions(+), 0 deletions(-)

lib/std/os/linux/x86.zig+2
...@@ -159,12 +159,14 @@ pub fn clone() callconv(.naked) u32 {...@@ -159,12 +159,14 @@ pub fn clone() callconv(.naked) u32 {
159pub fn restore() callconv(.naked) noreturn {159pub fn restore() callconv(.naked) noreturn {
160 switch (builtin.zig_backend) {160 switch (builtin.zig_backend) {
161 .stage2_c => asm volatile (161 .stage2_c => asm volatile (
162 \\ addl $4, %%esp
162 \\ movl %[number], %%eax163 \\ movl %[number], %%eax
163 \\ int $0x80164 \\ int $0x80
164 :165 :
165 : [number] "i" (@intFromEnum(SYS.sigreturn)),166 : [number] "i" (@intFromEnum(SYS.sigreturn)),
166 ),167 ),
167 else => asm volatile (168 else => asm volatile (
169 \\ addl $4, %%esp
168 \\ int $0x80170 \\ int $0x80
169 :171 :
170 : [number] "{eax}" (@intFromEnum(SYS.sigreturn)),172 : [number] "{eax}" (@intFromEnum(SYS.sigreturn)),