comp.lang.ada
 help / color / mirror / Atom feed
From: ASP@SEI.CMU.EDU (Spencer Peterson)
Subject: Re: A Bug in VAX Ada (ACCVIO)
Date: 8 Jan 88 20:30:29 GMT	[thread overview]
Message-ID: <1988.1.8.20.3.20.Alfred.Peterson@sei.cmu.edu> (raw)

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
 

             reply	other threads:[~1988-01-08 20:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-01-08 20:30 Spencer Peterson [this message]
1988-01-11  9:01 ` A Bug in VAX Ada (ACCVIO) paul
1988-01-12 19:41   ` Robert Firth
     [not found] <1@<1988>
1988-01-14 16:51 ` ron
1988-01-18 13:34   ` Robert Firth
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox