[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #172119)
Oliver Hunt via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Dec 20 23:33:59 PST 2025
================
@@ -923,6 +932,11 @@ namespace {
if (PointerAuthQualifier Q = F->getType().getPointerAuth();
Q && Q.isAddressDiscriminated())
return false;
+ // Non-trivially-copyable fields with pointer field protection need to be
+ // copied one by one.
+ if (!CGF.getContext().arePFPFieldsTriviallyCopyable(ClassDecl) &&
----------------
ojhunt wrote:
Maybe we should just have a ASTContext::isFieldAddressDependent(FieldDecl*)? it can wrap hasAddressDiscriminatedPointerAuth() (or whatever I named it) and the PFP check? Wouldn't depend on sharing data between the two, it can just do both checks sequentially, as I just realized while typing this comment that I'd been brainfarting may way through with PFP being decl based not type :D
https://github.com/llvm/llvm-project/pull/172119
More information about the llvm-branch-commits
mailing list