From 7fcad548360a6b9728de6844ddd0ea1807651a16 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Mon, 12 Dec 2011 18:16:10 +0000 Subject: Added dependent exception support to __cxa_current_exception_type llvm-svn: 146381 --- libcxxabi/src/cxa_exception.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libcxxabi/src/cxa_exception.cpp') diff --git a/libcxxabi/src/cxa_exception.cpp b/libcxxabi/src/cxa_exception.cpp index 6022740f4c4..9cf61a9aa5a 100644 --- a/libcxxabi/src/cxa_exception.cpp +++ b/libcxxabi/src/cxa_exception.cpp @@ -305,7 +305,11 @@ std::type_info * __cxa_current_exception_type() { __cxa_exception *current_exception = globals->caughtExceptions; if (NULL == current_exception) return NULL; // No current exception -// TODO add stuff for dependent exceptions. + if (isDependentException(¤t_exception->unwindHeader)) { + __cxa_dependent_exception* deh = + reinterpret_cast<__cxa_dependent_exception*>(current_exception + 1) - 1; + current_exception = static_cast<__cxa_exception*>(deh->primaryException) - 1; + } return current_exception->exceptionType; } -- cgit v1.2.3