From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fbb30b3a572ba6d0 X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: Finalization and Self Assignment Date: 2000/03/04 Message-ID: #1/1 X-Deja-AN: 593391161 X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 References: X-Trace: news.demon.co.uk 952258878 nnrp-09:8198 NO-IDENT pogner.demon.co.uk:158.152.70.98 Organization: At Home Newsgroups: comp.lang.ada X-Complaints-To: abuse@demon.net Date: 2000-03-04T00:00:00+00:00 List-Id: "Frank J. Lhota" writes: > Fortunately, on many platforms, self assignment is not an issue. Ada RM > 7.6(19) allows the following implementation permission in regards to the > assignment of controlled objects: > > - For an assignment_statement that assigns to an object the value of that > same object, the implementation need not do anything. > > ObjectAda as well as some (all?) versions of GNAT take advantage of this > permission. I would recommend that this permission be promoted to a > requirement. In other words, we should require that the compiler NOT do the > Finalize / Adjust calls when an object is assigned to itself. The issue here > is not so much efficiency as it is correctness. If we simply eliminate the > Finalize / Adjust calls from self assignments, these problems go away. There is, I'm sure, a serious bug in the OA demo compiler (the one that was given away with various books, in particular John Barnes'). As far as I can remember it was in exactly this area ..