Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cxx-abi-dev] __cxa_vec_new2 and deallocation functions that throw exceptions


  • To: Dennis Handly <dhandly@xxxxxxxxxx>
  • Subject: Re: [cxx-abi-dev] __cxa_vec_new2 and deallocation functions that throw exceptions
  • From: Mark Mitchell <mark@xxxxxxxxxxxxxxxx>
  • Date: 14 May 2003 22:32:00 -0700

On Wed, 2003-05-14 at 20:27, Dennis Handly wrote:
> >The ABI says that, for __cxa_vec_new2 and __cxa_vec_new3:
> >  If dealloc throws an exception, the result is undefined.
> 
> >I don't understand this restriction.  In particular, the ISO C++
> >standard says (if I read it correctly) that:
> 
> Please point to the sections where it says this.

[except.terminate]

In  the  following situations exception handling must be abandoned for
  less subtle error handling techniques:

  --when the exception handling mechanism, after  completing  evaluation
    of  the  expression  to be thrown but before the exception is caught
    (_except.throw_), calls a user function that exits via  an  uncaught
    exception,1)

[except.throw]

An exception is considered caught when initialization is complete  for
  the formal parameter of the corresponding catch clause, or when termi-
  nate() or unexpected() is entered due to a  throw.

In my example, the constructor throws an exception.  The exception has
not yet been caught.  The exception-handling mechanism calls a user
function (the deallocation routine) which exits via an exception.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@xxxxxxxxxxxxxxxx