[cxx-abi-dev] Flaws in spec for __cxa_begin_catch

Mark Mitchell mark at codesourcery.com
Fri Nov 19 06:53:16 UTC 2004


Cary Coutant wrote:

> It seems to me that the ABI spec for __cxa_begin_catch() may have been 
> OK after all, but we really needed another interface to get the adjusted 
> pointer prior to calling __cxa_begin_catch(). In the Bugzilla 
> discussion, Richard suggests "__cxa_begin_catch_part1" and 
> "__cxa_begin_catch_part2", but I'd suggest leaving __cxa_begin_catch() 
> as specified (with a void return), and adding a new interface
> 
>    void *__cxa_get_exception_ptr(void *exceptionObject);
> 
> The generated code can call this interface, run the copy constructor, 
> and then call __cxa_begin_catch().
> 
> Perhaps an improvement on this would be to have __cxa_begin_catch() also 
> return the adjusted pointer, so that we can avoid the extra call in 
> cases where we don't have a copy constructor.

That seems like a good strategy.  Would you care to submit a patch to 
the ABI spec?

Thanks,

-- 
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery.com
(916) 791-8304



More information about the cxx-abi-dev mailing list