[llvm-commits] llvm-gcc: call terminate if an exception handling cleanup throws an exception

Duncan Sands baldrick at free.fr
Tue Jul 17 05:01:43 PDT 2007


In gcc, if a language defines lang_protect_cleanup_actions then any exceptions thrown
by an exception handling cleanup ("destructor") are supposed to be routed to a call to
lang_protect_cleanup_actions.  Implement this like in gcc: wrap cleanups in a filter
that has as handler the code specified by lang_protect_cleanup_actions.  In C++ this
means a call to "terminate".  What happens if the handler itself throws an exception?
(This can happen in C++ because the standard terminate can be replaced by user defined
code.)  The runtime unwinder is supposed to deal with it, but in order for this to work
special support is required in the dwarf writer (plus some kind of annotation in the IR),
much the same as for nothrow functions.  Since we don't yet support nothrow functions I
didn't try to add any support for this a priori more complicated case.

Ciao,

Duncan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: protect.diff
Type: text/x-diff
Size: 9713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070717/c7901e11/attachment.diff>


More information about the llvm-commits mailing list