On 5 Jan 2010, at 05:17, 荒田 実樹 wrote:

> I was looking for an implementation of OSX-compatible runtime
> functions on top of the GNU runtime, and found ObjectiveC2.framework
> and libobjc2.  They seem to be exactly what I wanted.

Great!

> So I tested libobjc2 with my code and found some bugs:
> - method_getTypeEncoding is broken. It always returns (unsigned  
> int)-1.

I can't reproduce this.  I compile and run this program:

#import <objc/runtime.h>
#include <stdio.h>

int main(void)
{
        Method m = class_getInstanceMethod(objc_getClass("Object"), @selector 
(free));
        printf("Name: %s\n", sel_getName(method_getName(m)));
        printf("Types: %s\n", method_getTypeEncoding(m));
        printf("IMP: %d\n", method_getImplementation(m));
        return 0;
}

And I get:

Name: free
Types: @8...@0:4
IMP: 675116096

The runtime here is just getting the value set by the compiler, so if  
this is (unsigned int)-1 for you then it may be a compiler bug.  What  
compiler are you using?

> - class_getInstanceVariable does not check if cls->ivars!=NULL.
> - class_addMethod calls sel_get_typed_uid. Should call
> sel_register_typed_name.
> - class_addIvar refers to ivarlist->ivar_count even if ivarlist==NULL.

Fixed, thank you.  See r29214 for libobjc2 and r5724 for  
ObjectiveC2.framework.

> I hope this post would help you.

Yes, definitely.  Bug reports are always welcome, than you.

David

-- Sent from my brain


_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à