gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Broken objc_allocateClassPair


From: Luboš Doležel
Subject: Broken objc_allocateClassPair
Date: Mon, 14 Jan 2013 09:59:17 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2

Hi,

a hack used in dynamic class registration in libobjc2/runtime.c causes serious trouble for apps using this API.

This is the cause of trouble:

// Initialize the metaclass
// Set the meta-metaclass pointer to the name.  The runtime will fix this
// in objc_resolve_class().
metaClass->isa = (Class)superclass->isa->isa->name;

See the attached example app, which crashes.

I could use objc_resolve_class() in between class registrations, but that results in +load being called, which should not be happening at that point.

--
Luboš Doležel

Attachment: break_libobjc2.m
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]