comp.lang.ada
 help / color / mirror / Atom feed
* Re: A Bug in VAX Ada (ACCVIO)
@ 1988-01-08 20:30 Spencer Peterson
  1988-01-11  9:01 ` paul
  0 siblings, 1 reply; 5+ messages in thread
From: Spencer Peterson @ 1988-01-08 20:30 UTC (permalink / 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
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1988-01-18 13:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1@<1988>
1988-01-14 16:51 ` A Bug in VAX Ada (ACCVIO) ron
1988-01-18 13:34   ` Robert Firth
1988-01-08 20:30 Spencer Peterson
1988-01-11  9:01 ` paul
1988-01-12 19:41   ` Robert Firth

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