From owner-freebsd-bugs Sat Aug 28 1:30: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 9221614D35 for ; Sat, 28 Aug 1999 01:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id BAA30327; Sat, 28 Aug 1999 01:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freebsd.sinica.edu.tw (freebsd.sinica.edu.tw [140.109.13.51]) by hub.freebsd.org (Postfix) with ESMTP id 2E60B14D01 for ; Sat, 28 Aug 1999 01:20:49 -0700 (PDT) (envelope-from ycheng@freebsd.sinica.edu.tw) Received: (from ycheng@localhost) by freebsd.sinica.edu.tw (8.9.2/8.9.2) id QAA74263; Sat, 28 Aug 1999 16:24:28 +0800 (CST) (envelope-from ycheng) Message-Id: <199908280824.QAA74263@freebsd.sinica.edu.tw> Date: Sat, 28 Aug 1999 16:24:28 +0800 (CST) From: Yuan-Chen Cheng Reply-To: ycheng@sinica.edu.tw To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: gnu/13438: objc forward core dump using system cc Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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 + +@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 + +@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