Re: Which flavor of objc_msgSend for NSSize return
Re: Which flavor of objc_msgSend for NSSize return
- Subject: Re: Which flavor of objc_msgSend for NSSize return
- From: Rosyna <email@hidden>
- Date: Fri, 11 May 2007 17:35:55 -0700
Hmm, it's not passing my test on the ICBM.
#import <Foundation/Foundation.h>
#import <objc/objc-runtime.h>
@interface Foo : NSObject {} @end
@implementation Foo
+ (NSPoint)point { return NSMakePoint(1, 2); }
@end
int main(int argc, const char *argv[])
{
[NSAutoreleasePool new];
NSLog(@"Point is %@", NSStringFromPoint(((NSPoint (*)(id, SEL,
...))objc_msgSend_stret)([Foo class], @selector(point))));
return 0;
}
[stability-drive:~/Desktop] rosyna% gcc -framework Foundation donkey.m
[stability-drive:~/Desktop] rosyna% ./a.out
Segmentation fault
Changing objc_msgSend_stret to objc_msgSend works without crashing, however.
Ack, at 5/11/07, Sherm Pendley said:
The runtime reference simply says to call _stret for all structure
return types - it doesn't distinguish between struct sizes. I
followed that rule for CamelBones, and it passes all its self-tests
on i386, as well as running every app I've tried without fail.
--
Sincerely,
Rosyna Keller
Technical Support/Carbon troll/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden