[libcxx-commits] [compiler-rt] [libcxx] [libcxxabi] [libunwind] [runtimes][PAC] Harden unwinding when possible (PR #143230)
Daniil Kovalev via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Sep 3 05:16:17 PDT 2025
================
@@ -681,7 +681,18 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
// context struct, because it is allocated on the stack, and an exception
// could clobber the de-allocated portion of the stack after sp has been
// restored.
- ldr x16, [x0, #0x0F8]
+
+ ldr x16, [x0, #0x0F8] // load sp into scratch
+ ldr lr, [x0, #0x100] // restore pc into lr
+
+#if __has_feature(ptrauth_calls) || defined(__PTRAUTH__)
----------------
kovdan01 wrote:
Is this a correct check? It looks like that `#if __has_feature(ptrauth_returns)` (w/o check against `__PTRAUTH__`) is more suitable, isn't it? `__PTRAUTH__` just ensures that ptrauth intrinsics and header file are available, while here we want to ensure that RA is signed, don't we?
https://github.com/llvm/llvm-project/pull/143230
More information about the libcxx-commits
mailing list