[llvm-commits] llvm-gcc: handle TRY_CATCH_EXPR with compound-stmt for handler

Duncan Sands baldrick at free.fr
Tue May 1 10:32:50 PDT 2007


According to the documentation, the handler for a TRY_CATCH_EXPR can be:

- A sequence of statements to execute.  When an exception occurs,
these statements are executed, and then the exception is rethrown.

- A sequence of CATCH_EXPR expressions.  Each CATCH_EXPR
has a list of applicable exception types and handler code.  If the
thrown exception matches one of the caught types, the associated
handler code is executed.  If the handler code falls off the bottom,
execution continues after the original TRY_CATCH_EXPR.

- An EH_FILTER_EXPR expression.  This has a list of
permitted exception types, and code to handle a match failure.  If the
thrown exception does not match one of the allowed types, the
associated match failure code is executed.  If the thrown exception
does match, it continues unwinding the stack looking for the next
handler.

However GatherTypeInfo wasn't expecting the first case, causing a crash
when building the C++ runtime.  Fix and testcase attached.

Ciao,

Duncan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no_catch.diff
Type: text/x-diff
Size: 818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070501/b2ad714f/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2007-04-31-TryCatch.cpp
Type: text/x-c++src
Size: 242 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070501/b2ad714f/attachment.cpp>


More information about the llvm-commits mailing list