Commit fde1ec5d0e
Changed files (2)
lib
std
os
linux
lib/std/os/linux/x86.zig
@@ -125,36 +125,44 @@ pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *
pub fn restore() callconv(.Naked) void {
switch (@import("builtin").zig_backend) {
- .stage2_c => return asm volatile (
+ .stage2_c => asm volatile (
\\ movl %[number], %%eax
\\ int $0x80
+ \\ ret
:
: [number] "i" (@enumToInt(SYS.sigreturn)),
: "memory"
),
- else => return asm volatile ("int $0x80"
+ else => asm volatile (
+ \\ int $0x80
+ \\ ret
:
: [number] "{eax}" (@enumToInt(SYS.sigreturn)),
: "memory"
),
}
+ unreachable;
}
pub fn restore_rt() callconv(.Naked) void {
switch (@import("builtin").zig_backend) {
- .stage2_c => return asm volatile (
+ .stage2_c => asm volatile (
\\ movl %[number], %%eax
\\ int $0x80
+ \\ ret
:
: [number] "i" (@enumToInt(SYS.rt_sigreturn)),
: "memory"
),
- else => return asm volatile ("int $0x80"
+ else => asm volatile (
+ \\ int $0x80
+ \\ ret
:
: [number] "{eax}" (@enumToInt(SYS.rt_sigreturn)),
: "memory"
),
}
+ unreachable;
}
pub const O = struct {
lib/std/os/linux/x86_64.zig
@@ -109,7 +109,7 @@ pub const restore = restore_rt;
pub fn restore_rt() callconv(.Naked) void {
switch (@import("builtin").zig_backend) {
- .stage2_c => return asm volatile (
+ .stage2_c => asm volatile (
\\ movl %[number], %%eax
\\ syscall
\\ retq
@@ -117,12 +117,15 @@ pub fn restore_rt() callconv(.Naked) void {
: [number] "i" (@enumToInt(SYS.rt_sigreturn)),
: "rcx", "r11", "memory"
),
- else => return asm volatile ("syscall"
+ else => asm volatile (
+ \\ syscall
+ \\ retq
:
: [number] "{rax}" (@enumToInt(SYS.rt_sigreturn)),
: "rcx", "r11", "memory"
),
}
+ unreachable;
}
pub const mode_t = usize;