Skip to content

Commit d61fee3

Browse files
committed
[Runtime] Check the weak-linked _dyld_has_preoptimized_swift_protocol_conformances for NULL before calling it.
rdar://89522018
1 parent 10b5031 commit d61fee3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,8 @@ void swift::addImageProtocolConformanceBlockCallbackUnsafe(
581581
ConformanceSection{conformances, conformancesSize});
582582
return;
583583
#if DYLD_FIND_PROTOCOL_ON_DISK_CONFORMANCE_DEFINED
584-
} else if (_dyld_has_preoptimized_swift_protocol_conformances(
584+
} else if (&_dyld_has_preoptimized_swift_protocol_conformances &&
585+
_dyld_has_preoptimized_swift_protocol_conformances(
585586
reinterpret_cast<const mach_header *>(baseAddress))) {
586587
// dyld may optimize images outside the shared cache. Skip those too.
587588
DYLD_CONFORMANCES_LOG(

0 commit comments

Comments
 (0)