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

Mark Mitchell mark at codesourcery.com
Thu May 15 05:32:00 UTC 2003


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 at codesourcery.com




More information about the cxx-abi-dev mailing list