[LLVMdev] RFC: Exception Handling Proposal II

Renato Golin rengolin at systemcall.org
Thu Nov 25 05:19:11 PST 2010


On 25 November 2010 12:01, Duncan Sands <baldrick at free.fr> wrote:
> I see what you are saying now.  Unfortunately optimizations such as
> inlining can result in code ending up in cleanup landing pads.

This is the part that escapes me... but I haven't spent too much time
thinking about inlining EH information yet.


> OK :)  Essentially what happens is as follows: when running destructors
> when exiting a scope (which may be a nested scope), if a destructor throws
> an exception then any remaining destructors are first run, then the
> Program_Error exception is thrown at the point of the scope exit.  This
> may be caught by an enclosing handler.

That's a neat model.

What happens if two (or more) exceptions are thrown while you're
cleaning up another? For instance, if A's destructor also throws an
exception?

A's exception was not thrown while processing B's exception (but while
cleaning up *before* processing it), so it's not a nested exception,
but an "aside" exception...

It makes my head hurt... I think Stroustroup didn't want to think
about that, too... :D

cheers,
--renato




More information about the llvm-dev mailing list