Date: Sat, 28 Aug 1999 16:24:28 +0800 (CST) From: Yuan-Chen Cheng <ycheng@ml.tw.freebsd.org> To: FreeBSD-gnats-submit@freebsd.org Subject: gnu/13438: objc forward core dump using system cc Message-ID: <199908280824.QAA74263@freebsd.sinica.edu.tw>
next in thread | raw e-mail | index | archive | help
>Number: 13438 >Category: gnu >Synopsis: objc forward core dump using system cc >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 28 01:30:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Yuan-Chen Cheng >Release: FreeBSD 4.0-19990827-CURRENT i386 >Organization: ASCC >Environment: New install FreeBSD 4.0-19990827-CURRENT i386 >Description: objc forward feature not work. >How-To-Repeat: mkdir test cd test patch < following_patch cc *.m -Wall -lobjc ./a.out core dump with message: Inv val is 134561320 Floating point exception (core dumped) --- /dev/null Wed May 6 04:32:27 1998 +++ DelegatePool.h Wed Aug 11 08:34:58 1999 @@ -0,0 +1,10 @@ +#include <objc/Object.h> + +@interface DelegatePool : Object +{ + id a; +} +- (void) setDeleGate: anObject; +- forward:(SEL)aSel :(arglist_t)argFrame; +@end + --- /dev/null Wed May 6 04:32:27 1998 +++ DelegatePool.m Wed Aug 11 08:34:58 1999 @@ -0,0 +1,22 @@ + +#include "DelegatePool.h" + +@implementation DelegatePool + +- (void) setDeleGate: anObject +{ + a = anObject; +} + +- forward: (SEL)aSel :(arglist_t)argFrame +{ + void *ret = 0; + + if ([a respondsTo:aSel]) + { + ret = [a performv:aSel :argFrame]; + } + return ret; +} + +@end --- /dev/null Wed May 6 04:32:27 1998 +++ Int.h Wed Aug 11 08:34:58 1999 @@ -0,0 +1,11 @@ + +#include <objc/Object.h> + +@interface Int : Object +{ + int i; +} +- (void) set: (int) val; +- (void) print; +@end + --- /dev/null Wed May 6 04:32:27 1998 +++ Int.m Wed Aug 11 08:34:58 1999 @@ -0,0 +1,17 @@ + +#include "Int.h" + +@implementation Int + +- (void) set: (int) val +{ + i = val; +} + +- (void) print +{ + printf("Inv val is %i\n", i); +} + +@end + --- /dev/null Wed May 6 04:32:27 1998 +++ main.m Wed Aug 11 08:34:57 1999 @@ -0,0 +1,16 @@ +#include "Int.h" +#include "DelegatePool.h" + +int main() +{ + id i; + id d; + + i = [[Int new] init] ; + d = [[DelegatePool new] init]; + [d setDeleGate: i]; + [d print]; + return 0; +} + + >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908280824.QAA74263>