File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -2272,7 +2272,7 @@ namespace {
2272
2272
// Classify the type according to its stored properties.
2273
2273
for (auto field : D->getStoredProperties ()) {
2274
2274
auto pointerAuthQual = field->getPointerAuthQualifier ();
2275
- if (pointerAuthQual && pointerAuthQual. isAddressDiscriminated ()) {
2275
+ if (pointerAuthQual. isPresent ()) {
2276
2276
properties.setAddressOnly ();
2277
2277
}
2278
2278
auto substFieldType =
Original file line number Diff line number Diff line change @@ -48,6 +48,16 @@ func test_field_fn_ptr_swap() {
48
48
ptr_to_secure_struct!. pointee. secure_func_ptr2 = t
49
49
}
50
50
51
+ // CHECK-LABEL: sil hidden [ossa] @$s25ptrauth_field_fptr_import05test_B12_fn_ptr_temps5Int32VyF :
52
+ // CHECK: [[STK:%.*]] = alloc_stack $SecureStruct, let, name "struct_with_signed_val"
53
+ // CHECK: [[FLD:%.*]] = struct_element_addr [[STK]] : $*SecureStruct, #SecureStruct.secure_func_ptr1
54
+ // CHECK: [[SIGNED:%.*]] = begin_access [read] [signed] [[FLD]] : $*Optional<@convention(c) () -> Int32>
55
+ // CHECK-LABEL: } // end sil function '$s25ptrauth_field_fptr_import05test_B12_fn_ptr_temps5Int32VyF'
56
+ func test_field_fn_ptr_temp( ) -> Int32 {
57
+ let struct_with_signed_val = ptr_to_secure_struct. pointee
58
+ return struct_with_signed_val. secure_func_ptr1 ( )
59
+ }
60
+
51
61
// CHECK-LABEL: sil hidden [ossa] @$s25ptrauth_field_fptr_import024test_addr_discriminated_B8_fn_reads5Int32VyF :
52
62
// CHECK: [[GLOB:%.*]] = global_addr @ptr_to_addr_discriminated_secure_struct : $*Optional<UnsafeMutablePointer<AddressDiscriminatedSecureStruct>>
53
63
// CHECK: [[A1:%.*]] = begin_access [read] [dynamic] [[GLOB]] : $*Optional<UnsafeMutablePointer<AddressDiscriminatedSecureStruct>>
You can’t perform that action at this time.
0 commit comments