aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorbiexelar <biexelar@disroot.org>2022-08-31 02:31:47 +0000
committerGitHub <noreply@github.com>2022-08-30 22:31:47 -0400
commit59e33b447b0502bdfa18909f4381360bb8f49b70 (patch)
treee6fc69e9efb7109515f07e0d1c3a5cb88d1d24c0 /lib
parent56cfa8f22f69d813efedb1fa01fdcb7077ca0e5a (diff)
downloadzig-59e33b447b0502bdfa18909f4381360bb8f49b70.tar.gz
zig-59e33b447b0502bdfa18909f4381360bb8f49b70.zip
std.Thread: fix freeAndExit on x86_64-linux (#12693)
Previously, this function used incorrect registers for the munmap syscall, leading to detached threads not cleaning up. closes #12690 Co-authored-by: bxlr <biexelar@diroot.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/std/Thread.zig7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig
index d52515b88d..20985c36a0 100644
--- a/lib/std/Thread.zig
+++ b/lib/std/Thread.zig
@@ -769,16 +769,13 @@ const LinuxThreadImpl = struct {
),
.x86_64 => asm volatile (
\\ movq $11, %%rax
- \\ movq %[ptr], %%rbx
- \\ movq %[len], %%rcx
\\ syscall
\\ movq $60, %%rax
\\ movq $1, %%rdi
\\ syscall
:
- : [ptr] "r" (@ptrToInt(self.mapped.ptr)),
- [len] "r" (self.mapped.len),
- : "memory"
+ : [ptr] "{rdi}" (@ptrToInt(self.mapped.ptr)),
+ [len] "{rsi}" (self.mapped.len),
),
.arm, .armeb, .thumb, .thumbeb => asm volatile (
\\ mov r7, #91