From 9ea7300d77884d6bb039ff3badb8ed19b5bf3fb8 Mon Sep 17 00:00:00 2001 From: Aura Lily Vulcano Date: Mon, 24 Aug 2020 14:21:04 -0700 Subject: [PATCH] Avoid a crash when the hash value of an object is negative --- Sources/Foundation/RunLoop.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Foundation/RunLoop.swift b/Sources/Foundation/RunLoop.swift index 05cfa14946..b002e43ca6 100644 --- a/Sources/Foundation/RunLoop.swift +++ b/Sources/Foundation/RunLoop.swift @@ -323,7 +323,7 @@ extension RunLoop { }, hash: { (info) -> CFHashCode in let me = Unmanaged<_Source>.fromOpaque(info!).takeUnretainedValue() - return CFHashCode(me.hashValue) + return CFHashCode(bitPattern: me.hashValue) }, schedule: { (info, cfRunLoop, cfRunLoopMode) in let me = Unmanaged<_Source>.fromOpaque(info!).takeUnretainedValue()