llvm-project
ae18b941 - [PAC] Implement function pointer type discrimination (#96992)

Commit
1 year ago
[PAC] Implement function pointer type discrimination (#96992) Give users an option (-fptrauth-function-pointer-type-discrimination) to sign a function pointer using a non-zero discriminator based on the function type. The discriminator is computed by first translating the function type to a string and then computing the hash value of the string. Two function types that are compatible in C must be translated to the same string with the exception of function types that use typedefs of anonymous structs in their return type or parameter types. This patch doesn't have the code to resign function pointers, which is needed when a function pointer is converted to a different function type. That will be implemented in another patch. Co-authored-by: John McCall <rjmccall@apple.com> --------- Co-authored-by: John McCall <rjmccall@apple.com>
Author
Parents
Loading