[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)
Daniil Kovalev via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jun 19 14:53:30 PDT 2024
================
@@ -354,6 +354,23 @@ Given that ``signedPointer`` matches the layout for signed pointers signed with
the given key, extract the raw pointer from it. This operation does not trap
and cannot fail, even if the pointer is not validly signed.
+``ptrauth_sign_constant``
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: c
+
+ ptrauth_sign_constant(pointer, key, discriminator)
+
+Return a signed pointer for a constant address in a manner which guarantees
+a non-attackable sequence.
+
+``pointer`` must be a constant expression of pointer type which evaluates to
+a non-null pointer. The result will have the same type as ``discriminator``.
----------------
kovdan01 wrote:
Could you please reply to the previous comment in this thread? It was resolved, but the issue with the docs does not seem to be fixed. Please let me know if I miss smth and there is no issue - but, at least, we have different info in rst docs and in ptrauth.h header (the first one says that the result has the same type as `discriminator`, the second one - that the result's type is the same as the type of original value). So, things should at least be consistent. Ideally, we can just use the exact same text for description in both places, but I'm happy with different descriptions if they just match each other.
https://github.com/llvm/llvm-project/pull/93904
More information about the llvm-branch-commits
mailing list