summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src/cxa_exception.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2011-12-12 18:16:10 +0000
committerHoward Hinnant <hhinnant@apple.com>2011-12-12 18:16:10 +0000
commit7fcad548360a6b9728de6844ddd0ea1807651a16 (patch)
tree669eb153028a4d299e476e90811daf2988ce7083 /libcxxabi/src/cxa_exception.cpp
parent0444370645ac13eff5a688414821afed2b56ac35 (diff)
downloadbcm5719-llvm-7fcad548360a6b9728de6844ddd0ea1807651a16.tar.gz
bcm5719-llvm-7fcad548360a6b9728de6844ddd0ea1807651a16.zip
Added dependent exception support to __cxa_current_exception_type
llvm-svn: 146381
Diffstat (limited to 'libcxxabi/src/cxa_exception.cpp')
-rw-r--r--libcxxabi/src/cxa_exception.cpp6
1 files changed, 5 insertions, 1 deletions
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(&current_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;
}
OpenPOWER on IntegriCloud