comp.lang.ada
 help / color / mirror / Atom feed
From: bhanafee@ADS.COM (Brian Hanafee)
Subject: Re: Storage Error
Date: 13 Nov 90 03:51:28 GMT	[thread overview]
Message-ID: <+}&^%H#@ads.com> (raw)
In-Reply-To: 108637@convex.convex.com

In article <108637@convex.convex.com> gargulak@mozart.convex.com (Tom Gargulak) writes:
>I got the following example from the book by Barnes (pg. 183).  Barnes 
>claims that this program should raise the STORAGE_ERROR exception
>and I agree due to 11.4.1(10) in the LRM.  A colleague believes that
>Barnes is mistaken and that it would be acceptable for the program
>to run forever.  He claims it depends how the stack is implemeted.
[stuff deleted]
>
>procedure P is
>begin
>  P;
>exception
>  when others =>
>    P;
>end;


I believe that there are three possible (implementation dependent)
behaviours for this program:

Case 1:
  The compiler generated code does not require any new storage for
each new invocation of P.  In this case, the program will not run out
of storage, and may acceptably run forever.

Case 2:
  If the implementation requires that each invocation of P uses some
new storage (such as stack space), then eventually an invocation of P
will cause a STORAGE_ERROR.  The invocation of P from the handler will
(presumably) cause a *new* STORAGE_ERROR to be raised.  Under
11.4.1(10), this exception will cause the program to raise
STORAGE_ERROR.

Case 3:
  After STORAGE_ERROR is first raised, the program could detect that the
invocation of P from the handler is erroneous, and raise PROGRAM_ERROR
instead.


------------------------------------------------------------------------
Brian Hanafee                    | **Standard Disclaimer**
Advanced Decision Systems        |
------------------------------------------------------------------------

  reply	other threads:[~1990-11-13  3:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-11-13  0:22 Storage Error Tom Gargulak
1990-11-13  3:51 ` Brian Hanafee [this message]
1990-11-13 18:23 ` Tom Gargulak
  -- strict thread matches above, loose matches on Subject: below --
1998-07-20  0:00 Storage error Scott Sheffield
1998-07-20  0:00 ` Stephen Leake
replies disabled

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