Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This repository was archived by the owner on May 28, 2025. It is now read-only.

UINibUnarchiver should not use alloc without init, nor assume all classes have init #1105

@ms-jihua

Description

@ms-jihua

UINibUnarchiver.mm
pObj->cachedId = [classId alloc];

alloc without init is considered invalid, and the way constructObject() is currently written may leave pObj->cachedId as an invalid object (this would be the case with any of our bridged classes, where alloc alone would return just our prototype object)

Additionally, not all classes respond to [[class alloc] init]. (eg: [[UIFont alloc] init] crashes on the reference platform, and our new implementation on the CT-DW branch also does not respect alloc->init)

I ran into this issue with UIFont specifically, so I left a quick special-case there for it on CT-DW to unblock myself, but someone should take a look at this and make a proper fix for it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions