Article View: gnu.gcc.bug
Article #41Objective-C bug and fix
From: Chris Dodd
Date: Mon, 02 Nov 1992 09:05
Date: Mon, 02 Nov 1992 09:05
24 lines
1191 bytes
1191 bytes
I'm not sure if this is the right place to send this; there doesn't
seem to be objc-specific bug mailing list.
Basically, the problem is that the receiver of every message expression
gets evaluated twice; this causes problems if the receiver-expression
has side effects. Patch:
*** objc-actions.c.orig Mon Nov 2 16:38:25 1992
--- objc-actions.c Mon Nov 2 16:50:20 1992
***************
*** 2631,2636 ****
--- 2631,2638 ----
if (statically_allocated)
receiver = build_unary_op (ADDR_EXPR, receiver, 0);
+ /* don't evaluate the receiver twice */
+ receiver = save_expr(receiver);
self_object = receiver;
}
else
-------------------------------------------------------
Chris Dodd
dodd@csl.sri.com
Technical Details
Message-ID:
<9211030105.AA27564@pekoe.csl.sri.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!hri.com!spool.mu.edu!caen!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!csl.sri.com!doddShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!hri.com!spool.mu.edu!caen!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!csl.sri.com!dodd From: dodd@csl.sri.com (Chris Dodd) Newsgroups: gnu.gcc.bug Subject: Objective-C bug and fix Message-ID: <9211030105.AA27564@pekoe.csl.sri.com> Date: 2 Nov 92 09:05:18 GMT Sender: gnulists@ai.mit.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 24 Approved: bug-gcc@prep.ai.mit.edu