var nominalTypeDescriptor: NominalTypeDescriptor? {
let pointer = UnsafePointer<Int>(self.pointer)
let base = pointer.advanced(by: nominalTypeDescriptorOffsetLocation)
if base.pointee == 0 {
// swift class created dynamically in objc-runtime didn't have valid nominalTypeDescriptor
return nil
}
return NominalTypeDescriptor(pointer: relativePointer(base: base, offset: base.pointee-base.hashValue))
}
将offset:pointee 修改为将offset:base.pointee-base.hashValue
网友评论