diff options
author | anonymous <local@localhost> | 2010-11-25 04:16:44 +0000 |
---|---|---|
committer | anonymous <local@localhost> | 2010-11-25 04:16:44 +0000 |
commit | 0f29a300da1302eb27b0c5f561834d3a7ce5dfe4 (patch) | |
tree | 23afc0726d43d995f48b107d8a040b3a89cc65b7 /src | |
parent | e86befa5c02daa2fdc80539794a5208cbd5bbe28 (diff) | |
download | libcxxrt-0f29a300da1302eb27b0c5f561834d3a7ce5dfe4.tar.gz libcxxrt-0f29a300da1302eb27b0c5f561834d3a7ce5dfe4.tar.bz2 libcxxrt-0f29a300da1302eb27b0c5f561834d3a7ce5dfe4.tar.xz |
Fixed throwing / catching pointers.
Diffstat (limited to 'src')
-rw-r--r-- | src/exception.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/exception.cc b/src/exception.cc index bdf42a8..ecc3732 100644 --- a/src/exception.cc +++ b/src/exception.cc @@ -583,6 +583,11 @@ static std::type_info *get_type_info_entry(_Unwind_Context *context, static bool check_type_signature(__cxa_exception *ex, std::type_info *type) { void *exception_ptr = (void*)(ex+1); + __pointer_type_info *ptr_type = dynamic_cast<__pointer_type_info*>(ex->exceptionType); + if (0 != ptr_type) + { + exception_ptr = *(void**)exception_ptr; + } // Always match a catchall, even with a foreign exception // // Note: A 0 here is a catchall, not a cleanup, so we return true to @@ -613,6 +618,15 @@ static bool check_type_signature(__cxa_exception *ex, std::type_info *type) ex->adjustedPtr = cls_type->cast_to(exception_ptr, target_cls_type); return 0 != ex->adjustedPtr; } + __pointer_type_info *target_ptr_type = dynamic_cast<__pointer_type_info*>(type); + if ((0 != ptr_type) && (0 != target_ptr_type) && + (ptr_type->__pointee == target_ptr_type->__pointee) && + ((target_ptr_type->__flags & ~__pbase_type_info::__const_mask) == + ptr_type->__flags)) + { + ex->adjustedPtr = exception_ptr; + return true; + } return false; } /** |