Skip to content

Commit 819d984

Browse files
authored
stdlib/public/core: use UInt(bitPattern:) to make sure casts work
1 parent 8124738 commit 819d984

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: stdlib/public/core/DebuggerSupport.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,11 @@ public func _debuggerTestingCheckExpect(_: String, _: String) { }
270270

271271
// Utilities to get refcount(s) of class objects.
272272
public func _getRetainCount(_ Value: AnyObject) -> UInt {
273-
return UInt(swift_retainCount(unsafeBitCast(Value, to: UnsafeMutablePointer<HeapObject>.self)))
273+
return UInt(bitPattern: swift_retainCount(unsafeBitCast(Value, to: UnsafeMutablePointer<HeapObject>.self)))
274274
}
275275
public func _getUnownedRetainCount(_ Value: AnyObject) -> UInt {
276-
return UInt(swift_unownedRetainCount(unsafeBitCast(Value, to: UnsafeMutablePointer<HeapObject>.self)))
276+
return UInt(bitPattern: swift_unownedRetainCount(unsafeBitCast(Value, to: UnsafeMutablePointer<HeapObject>.self)))
277277
}
278278
public func _getWeakRetainCount(_ Value: AnyObject) -> UInt {
279-
return UInt(swift_weakRetainCount(unsafeBitCast(Value, to: UnsafeMutablePointer<HeapObject>.self)))
279+
return UInt(bitPattern: swift_weakRetainCount(unsafeBitCast(Value, to: UnsafeMutablePointer<HeapObject>.self)))
280280
}

0 commit comments

Comments
 (0)