[Bug objc/11754] [objc-improvements-branch] receiver is evaluated twice when passing messages with the gnu runtime

alexander at malmberg dot org gcc-bugzilla@gcc.gnu.org
Thu Jul 31 23:49:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11754


alexander at malmberg dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |


------- Additional Comments From alexander at malmberg dot org  2003-07-31 23:49 -------
Unfortunately, there's a typo in the committed fix:

+      if (!supper_flag)

should be "super_flag", not "supper_flag".

Also, it's worth noting that this doesn't apply only to cascaded messages,
although that's where I discovered it. Incorrect code will be generated when the
expression for the receiver has any kind of side effect, and pessimal code in
other cases. Eg.

[SomeClass foo] would call objc_get_class("SomeClass") twice (which is harmless)

and

[someFunction() foo] would call someFunction() twice, which has a good chance of
not being harmless



More information about the Gcc-bugs mailing list