comp.lang.ada
 help / color / mirror / Atom feed
From: Christoph Grein <christoph.grein@eurocopter.com>
Subject: Re: Unchecked_Deallocation and Constraint_Error
Date: Tue, 19 Feb 2002 13:13:35 +0100 (MET)
Date: 2002-02-19T13:13:35+01:00	[thread overview]
Message-ID: <mailman.1014120903.15641.comp.lang.ada@ada.eu.org> (raw)

> > ...
> >   Cmd : Integer_Array_Access := new Integer_Array(1..1);
> > ...
> >    Free(Cmd);
> >    Cmd(1) := 1;
> > ...
> >
> > Program should throw exception Constraint_Error, but it only
> > hangs at instruction Cmd(1) := 1; (but doesn't quit).
> 
> The Reference Manual is quite clear (section 13.11.2):
> 
> |                           _Erroneous Execution_
> |
> | 16. Evaluating a name that denotes a nonexistent object is erroneous.
> 
> You cannot expect that a Constraint_Error exception is raised in this
> case, unless your compiler documentation guarantees this.

That's correct, but 13.11.2(7) specifies that the value of Cmd is null after UD 
(I assume Free is an instantiation of UD), so a dereference Cmd(1) must raise 
CE, except 
when checks are suppressed.



             reply	other threads:[~2002-02-19 12:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-19 12:13 Christoph Grein [this message]
2002-02-19 12:54 ` Unchecked_Deallocation and Constraint_Error Florian Weimer
2002-02-19 14:15   ` Marin David Condic
2002-02-20 18:59     ` Robert Dewar
2002-02-20 22:45       ` Marin David Condic
2002-02-26 22:37     ` Michal Nowikowski
  -- strict thread matches above, loose matches on Subject: below --
2002-02-19 11:11 Michal Nowikowski
2002-02-19 11:59 ` Florian Weimer
2002-02-19 16:34   ` Jim Gleason
2002-02-19 23:23   ` Robert Dewar
replies disabled

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