mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
std.os.linux.x86: fix signal restore function
After handling any signal on x86, it would previously segfault.
This commit is contained in:
parent
030b630829
commit
1553c8eae7
@ -159,12 +159,14 @@ pub fn clone() callconv(.naked) u32 {
|
|||||||
pub fn restore() callconv(.naked) noreturn {
|
pub fn restore() callconv(.naked) noreturn {
|
||||||
switch (builtin.zig_backend) {
|
switch (builtin.zig_backend) {
|
||||||
.stage2_c => asm volatile (
|
.stage2_c => asm volatile (
|
||||||
|
\\ addl $4, %%esp
|
||||||
\\ movl %[number], %%eax
|
\\ movl %[number], %%eax
|
||||||
\\ int $0x80
|
\\ int $0x80
|
||||||
:
|
:
|
||||||
: [number] "i" (@intFromEnum(SYS.sigreturn)),
|
: [number] "i" (@intFromEnum(SYS.sigreturn)),
|
||||||
),
|
),
|
||||||
else => asm volatile (
|
else => asm volatile (
|
||||||
|
\\ addl $4, %%esp
|
||||||
\\ int $0x80
|
\\ int $0x80
|
||||||
:
|
:
|
||||||
: [number] "{eax}" (@intFromEnum(SYS.sigreturn)),
|
: [number] "{eax}" (@intFromEnum(SYS.sigreturn)),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user