PNaCl SJLJ EH: Fix handling of dependent exceptions

Dereferencing xh->exceptionType isn't valid for dependent exceptions
(those thrown with std::rethrow_exception(), added in C++11), because
xh might point to inside a __cxa_dependent_exception, which, in
libsupc++, shares some but not all of the layout of __cxa_exception.

We must get exceptionType from
__get_exception_header_from_obj(__get_object_from_ue(ue_header))
rather than from __get_exception_header_from_ue(ue_header).

That is because __get_object_from_ue() checks for dependent exceptions
and returns the pointer associated with the original __cxa_exception.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3696
TEST=run_eh_throw_tests_sjlj_test (with extra test added)

Review URL: https://codereview.chromium.org/97603002
1 file changed