[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #172119)
Peter Collingbourne via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jan 12 19:34:57 PST 2026
================
@@ -5627,15 +5754,25 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
} else {
uint64_t SrcSize = SrcTypeSize.getFixedValue();
uint64_t DstSize = DstTypeSize.getFixedValue();
+ bool HasPFPFields = !findPFPCoercedFields(*this, I->Ty).empty();
----------------
pcc wrote:
This needs to be the same as the condition where `CreatePFPCoercedLoad` would return non-null; `!findPFPCoercedFields().empty()` has a different value than `hasPFPFields()` because the former checks `IsWithinUnion`.
`IsWithinUnion` was added to support trivial relocation. If we're removing the trivial relocation support, I think we might be able to remove `IsWithinUnion` and have `findPFPFields` not return fields within unions. Then everything will be calling `hasPFPFields` or `findPFPFields`.
https://github.com/llvm/llvm-project/pull/172119
More information about the llvm-branch-commits
mailing list