[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
Tue Oct 14 08:38:44 PDT 2025


================
@@ -90,6 +90,23 @@
   } while (0)
 #endif
 
+// We need this helper function as the semantics of casting between integers and
+// function pointers mean that we end up with a function pointer without the
+// correct signature. Instead we assign to an integer with a matching schema,
+// and then memmove the result into a variable of the correct type. This memmove
+// is possible as `_Unwind_Personality_Fn` is a standard function pointer, and
+// as such is not address diversified.
+static _Unwind_Personality_Fn get_handler_function(unw_proc_info_t *frameInfo) {
+  uintptr_t __unwind_ptrauth_restricted_intptr(ptrauth_key_function_pointer,
+                                               0,
+                                               ptrauth_function_pointer_type_discriminator(_Unwind_Personality_Fn))
----------------
kovdan01 wrote:

It looks like that `ptrauth_function_pointer_type_discriminator` is not defined anywhere, and this causes compile error for me locally. Please either add a definition for that or just use `ptrauth_type_discriminator`.

https://github.com/llvm/llvm-project/pull/143230


More information about the libcxx-commits mailing list