Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[LibC] Add sigsetjmp and siglongjmp for arm/x64 darwin #138417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlyElashram
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented May 3, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- libc/src/setjmp/darwin/X86_64/sigsetjmp.cpp libc/src/setjmp/darwin/arm/sigsetjmp.cpp libc/src/setjmp/darwin/sigsetjmp_epilogue.cpp
View the diff from clang-format here.
diff --git a/libc/src/setjmp/darwin/X86_64/sigsetjmp.cpp b/libc/src/setjmp/darwin/X86_64/sigsetjmp.cpp
index b358e5d95..3049eefe8 100644
--- a/libc/src/setjmp/darwin/X86_64/sigsetjmp.cpp
+++ b/libc/src/setjmp/darwin/X86_64/sigsetjmp.cpp
@@ -35,7 +35,7 @@ LLVM_LIBC_FUNCTION(int, sigsetjmp, (sigjmp_buf buf, int save_mask)) {
 
 .Lnosave:
       jmp %P[setjmp]                // jump directly to setjmp if no save mask is provided
-  )" :: [retaddr] "i"(offsetof(__jmp_buf, sig_retaddr)),
+  )" ::[retaddr] "i"(offsetof(__jmp_buf, sig_retaddr)),
       [extra] "i"(offsetof(__jmp_buf, sig_extra)), [setjmp] "X"(setjmp),
       [epilogue] "X"(sigsetjmp_epilogue)
       : "rax", "rbx", "rdi", "rsi");
diff --git a/libc/src/setjmp/darwin/sigsetjmp_epilogue.cpp b/libc/src/setjmp/darwin/sigsetjmp_epilogue.cpp
index 4f8e4c39a..28d364289 100644
--- a/libc/src/setjmp/darwin/sigsetjmp_epilogue.cpp
+++ b/libc/src/setjmp/darwin/sigsetjmp_epilogue.cpp
@@ -15,10 +15,12 @@ namespace LIBC_NAMESPACE_DECL {
 [[gnu::returns_twice]] int sigsetjmp_epilogue(jmp_buf buffer, int retval) {
   if (retval) {
     // Restore signal mask from the buffer using syscall_impl for macOS
-    syscall_impl<long>(SYS_rt_sigprocmask, SIG_SETMASK, &buffer->sigmask, nullptr, sizeof(sigset_t));
+    syscall_impl<long>(SYS_rt_sigprocmask, SIG_SETMASK, &buffer->sigmask,
+                       nullptr, sizeof(sigset_t));
   } else {
     // Save the current signal mask to the buffer using syscall_impl for macOS
-    syscall_impl<long>(SYS_rt_sigprocmask, SIG_BLOCK, nullptr, &buffer->sigmask, sizeof(sigset_t));
+    syscall_impl<long>(SYS_rt_sigprocmask, SIG_BLOCK, nullptr, &buffer->sigmask,
+                       sizeof(sigset_t));
   }
   return retval;
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant