@@ -391,18 +391,20 @@ getMetadataFromPointerKeyedMap(const LibPrespecializedState &state,
391391 const TypeContextDescriptor *description,
392392 const void *const *arguments) {
393393#if DYLD_FIND_POINTER_HASH_TABLE_ENTRY_DEFINED
394- auto *generics = description->getGenericContext ();
395- if (!generics)
396- return nullptr ;
394+ if (SWIFT_RUNTIME_WEAK_CHECK (_dyld_find_pointer_hash_table_entry)) {
395+ auto *generics = description->getGenericContext ();
396+ if (!generics)
397+ return nullptr ;
397398
398- auto argumentCount = generics->getGenericContextHeader ().NumKeyArguments ;
399+ auto argumentCount = generics->getGenericContextHeader ().NumKeyArguments ;
399400
400- auto *map = state.data ->getPointerKeyedMetadataMap ();
401- auto result = _dyld_find_pointer_hash_table_entry (
402- map, description, argumentCount, const_cast <const void **>(arguments));
403- LOG (" Looking up description %p in dyld table, found %p." , description,
404- result);
405- return reinterpret_cast <Metadata *>(const_cast <void *>(result));
401+ auto *map = state.data ->getPointerKeyedMetadataMap ();
402+ auto result = SWIFT_RUNTIME_WEAK_USE (_dyld_find_pointer_hash_table_entry (
403+ map, description, argumentCount, const_cast <const void **>(arguments)));
404+ LOG (" Looking up description %p in dyld table, found %p." , description,
405+ result);
406+ return reinterpret_cast <Metadata *>(const_cast <void *>(result));
407+ }
406408#else
407409 LOG (" Looking up description %p but dyld hash table call not available." ,
408410 description);
0 commit comments