mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 05:56:05 +00:00

Signing a null pointer value can, and usually will, result in some high bits being set, causing null checks to fail. E.g. in extern void __attribute__((weak_import)) f(void); void (*p) = &f; if f is undefined then p should be null (left unsigned). This patch updates lowerPointer64AuthEdgesToSigningFunction to check for Pointer64Authenticated edges to null targets. Where found, these edges are turned into plain Pointer64 edges (which we know from context will write a null value to the fixup location), and signing instructions for these locations are omitted from the signing function.