From: Victor Porton <porton@narod.ru>
Subject: Re: Aborting a recursive subprogram by an exception
Date: Thu, 28 Aug 2014 22:59:40 +0300
Date: 2014-08-28T22:59:40+03:00 [thread overview]
Message-ID: <lto1nd$ehp$1@speranza.aioe.org> (raw)
In-Reply-To: ltnvq2$9v1$1@speranza.aioe.org
Victor Porton wrote:
> See also
> http://stackoverflow.com/questions/25556441/aborting-a-recursive-subprogram-in-the-middle
>
> If I want to abort a recursive subprogram in the middle, is throwing an
> exception from it a good way to do this?
>
> I am not sure whether exception optimizations allowed by Ada RM may not
> nullify some external actions of the subprogram (such as modifying global
> variables) which are before throwing the exception.
>
> Will it work with exceptions the right way?
I see that it will work as it should.
Ada2012 "11.6 Exceptions and Optimization" allows additional optimizations
only for language-defined checks. Explicit "raise" statement should work as
expected.
--
Victor Porton - http://portonvictor.org
prev parent reply other threads:[~2014-08-28 19:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 19:26 Aborting a recursive subprogram by an exception Victor Porton
2014-08-28 19:59 ` Victor Porton [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox