Skip to content

Commit 3f79cb9

Browse files
committed
[Runtime] Replace outdated signature for associated type access functions.
The resolution of generic parameter references, which is used for checking generic requirements at runtime, was written in terms of an outdated signature for associated type access functions that did not account for the MetadataRequest parameter or MetadataResponse result. Use the existing AssociatedTypeAccessFunction typedef instead. Fixes SR-7553 / rdar://problem/39769906
1 parent ea9f0ea commit 3f79cb9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,12 +689,10 @@ static const Metadata *resolveGenericParamRef(
689689
protocolDescriptor->getRequirements().data();
690690

691691
// Call the associated type access function.
692-
using AssociatedTypeAccessFn =
693-
const Metadata *(*)(const Metadata *base, const WitnessTable *);
694692
unsigned adjustedIndex = index + WitnessTableFirstRequirementOffset;
695693
current =
696-
((const AssociatedTypeAccessFn *)witnessTable)[adjustedIndex]
697-
(current, witnessTable);
694+
((AssociatedTypeAccessFunction * const *)witnessTable)[adjustedIndex]
695+
(MetadataState::Abstract, current, witnessTable).Value;
698696
if (!current) return nullptr;
699697
}
700698

0 commit comments

Comments
 (0)