From 0a5bff05fe01dcd513932ed338a4efad8268b803 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 27 Feb 2024 10:24:39 -0800 Subject: [PATCH] Fix Xcode 15.3 Release Crash (#108) A SIL function we load seems to be unavailable, so let's limit old key path printing to DEBUG builds. --- Sources/CustomDump/Conformances/KeyPath.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/CustomDump/Conformances/KeyPath.swift b/Sources/CustomDump/Conformances/KeyPath.swift index 24dacbc..4ad07fd 100644 --- a/Sources/CustomDump/Conformances/KeyPath.swift +++ b/Sources/CustomDump/Conformances/KeyPath.swift @@ -8,7 +8,7 @@ extension AnyKeyPath: CustomDumpStringConvertible { return self.debugDescription } #endif - #if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) + #if DEBUG && (os(iOS) || os(macOS) || os(tvOS) || os(watchOS)) keyPathToNameLock.lock() defer { keyPathToNameLock.unlock() } @@ -49,7 +49,7 @@ extension AnyKeyPath: CustomDumpStringConvertible { } } -#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) +#if DEBUG && (os(iOS) || os(macOS) || os(tvOS) || os(watchOS)) private var keyPathToNameLock = NSRecursiveLock() private var keyPathToName: [AnyKeyPath: String] = [:]