File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ internal let NSKeyedArchivePlistVersion = 100000
20
20
internal let NSKeyedArchiverSystemVersion : UInt32 = 2000
21
21
22
22
internal func objectRefGetValue( objectRef : CFKeyedArchiverUID ) -> UInt32 {
23
+ if objectRef. dynamicType != __NSCFType. self ||
24
+ CFGetTypeID ( objectRef) != _CFKeyedArchiverUIDGetTypeID ( ) {
25
+ fatalError ( " Object \( objectRef) is not a CFKeyedArchiverUID " )
26
+ }
23
27
return _CFKeyedArchiverUIDGetValue ( unsafeBitCast ( objectRef, CFKeyedArchiverUIDRef . self) )
24
28
}
25
29
internal var NSPropertyListClasses : [ AnyClass ] = [
Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ public class NSKeyedUnarchiver : NSCoder {
355
355
Returns true if objectOrReference represents a reference to another object in the archive
356
356
*/
357
357
internal class func _isReference( objectOrReference : Any ? ) -> Bool {
358
- if let cf = objectOrReference as? AnyObject {
358
+ if let cf = objectOrReference as? __NSCFType {
359
359
return CFGetTypeID ( cf) == _CFKeyedArchiverUIDGetTypeID ( )
360
360
} else {
361
361
return false
You can’t perform that action at this time.
0 commit comments