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=0.6 required=5.0 tests=BAYES_05,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!ucbcad!ucbvax!SEI.CMU.EDU!ASP From: ASP@SEI.CMU.EDU (Spencer Peterson) Newsgroups: comp.lang.ada Subject: Re: A Bug in VAX Ada (ACCVIO) Message-ID: <1988.1.8.20.3.20.Alfred.Peterson@sei.cmu.edu> Date: 8 Jan 88 20:30:29 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet List-Id: This message is a response to the perceived bug found with VAX Ada using an access type, UNCHECKED_DEALLOCATION and a constant and a variable of the access type. "Ceci est un exemple..." The "exemple" procedure/program is ERRONEOUS. I quote, with meaningful substitutions, from the Ada Reference Manual( Chapter 13.10.1, Para. 6). "If A and B designate the same object, then accessing that object through B is erroneous if this access is performed (or attempted) after the call DISPOSE(A); the effect of each such access is not defined by the language." The program behaves as correctly as it can, given that it is 'legal' for a compiler to optimize use of storage by NOT allocating a fresh copy of the string contents, although it would be prefered that a second copy be made and thus, no problem would occur when the original is DISPOSEd. The effect of making a copy of the contents of an access type, in this case, is the same as if B were a constant of type ACCESS_STRING, i.e. B : constant ACCESS_STRING := A; Spencer Peterson Member of The Technical Staff Software Engineering Institute Carnegie Mellon University 5000 Forbes Ave. Pittsburgh, PA 15213 412-268-7608