From 451a9ce9ffcf18db365f32a5a01dd025ab26c1d0 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Mon, 14 Jul 2025 19:32:18 -0700 Subject: [clang][ObjC][PAC] Add ptrauth protections to objective-c (#147899) This PR introduces the use of pointer authentication to objective-c[++]. This includes: * __ptrauth qualifier support for ivars * protection of isa and super fields * protection of SEL typed ivars * protection of class_ro_t data * protection of methodlist pointers and content --- clang/lib/CodeGen/CodeGenModule.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c8866f1..678be07 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -6616,7 +6616,9 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) { auto Fields = Builder.beginStruct(STy); // Class pointer. - Fields.add(cast(CFConstantStringClassRef)); + Fields.addSignedPointer(cast(CFConstantStringClassRef), + getCodeGenOpts().PointerAuth.ObjCIsaPointers, + GlobalDecl(), QualType()); // Flags. if (IsSwiftABI) { -- cgit v1.1