diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-30 19:13:32 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-30 19:13:32 +0000 |
commit | 879e6664462821e8f43500b22229bb2ac1e09cea (patch) | |
tree | ff6fbe2138242f2438e6bb48988cae82c4cf1a68 /libstdc++-v3 | |
parent | a36ec8263c25ecfe4e83aa19eaf33244394baa9c (diff) | |
download | gcc-879e6664462821e8f43500b22229bb2ac1e09cea.tar.gz |
2011-06-30 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 175718 using svnmerge.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@175720 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 14 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/deque | 9 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/forward_list | 1 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/list | 11 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/map.h | 20 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/multimap.h | 9 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/multiset.h | 9 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/set.h | 10 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/string | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/unordered_map | 20 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/unordered_set | 20 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/vector | 9 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/eh_arm.cc | 61 |
13 files changed, 99 insertions, 98 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d16aa1e3bc7..cd0b2934008 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,17 @@ +2011-06-29 François Dumont <francois.cppdevs@free.fr> + + * include/debug/set.h, unordered_map, multiset.h, forward_list, + unordered_set, vector, deque, string, list, multimap.h: Remove + base class default constructor calls. + * include/debug/map.h: Likewise and cleanup several redefinition of + base iterator typedef. + +2011-06-29 Nathan Sidwell <nathan@codesourcery.com> + + * libsupc++/eh_arm.c (__cxa_type_match): Construct address of + thrown object here. Return succeded_with_ptr_to_base for all + pointer cases. + 2011-06-23 Jonathan Wakely <jwakely.gcc@gmail.com> * testsuite/tr1/6_containers/tuple/creation_functions/tie2.cc: Fix for diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque index 5b6bdeb544a..08c1cdfd0b4 100644 --- a/libstdc++-v3/include/debug/deque +++ b/libstdc++-v3/include/debug/deque @@ -45,7 +45,6 @@ namespace __debug public __gnu_debug::_Safe_sequence<deque<_Tp, _Allocator> > { typedef _GLIBCXX_STD_C::deque<_Tp, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence<deque> _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; @@ -98,19 +97,19 @@ namespace __debug { } deque(const deque& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } deque(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ deque(deque&& __x) - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } deque(initializer_list<value_type> __l, const allocator_type& __a = allocator_type()) - : _Base(__l, __a), _Safe_base() { } + : _Base(__l, __a) { } #endif ~deque() _GLIBCXX_NOEXCEPT { } diff --git a/libstdc++-v3/include/debug/forward_list b/libstdc++-v3/include/debug/forward_list index 9f1da5b679f..b74b38a02bc 100644 --- a/libstdc++-v3/include/debug/forward_list +++ b/libstdc++-v3/include/debug/forward_list @@ -46,7 +46,6 @@ namespace __debug public __gnu_debug::_Safe_sequence<forward_list<_Tp, _Alloc> > { typedef _GLIBCXX_STD_C::forward_list<_Tp, _Alloc> _Base; - typedef __gnu_debug::_Safe_sequence<forward_list> _Safe_base; typedef typename _Base::iterator _Base_iterator; typedef typename _Base::const_iterator _Base_const_iterator; diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list index 44a208bfe52..3931a3d3b68 100644 --- a/libstdc++-v3/include/debug/list +++ b/libstdc++-v3/include/debug/list @@ -45,7 +45,6 @@ namespace __debug public __gnu_debug::_Safe_sequence<list<_Tp, _Allocator> > { typedef _GLIBCXX_STD_C::list<_Tp, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence<list> _Safe_base; typedef typename _Base::iterator _Base_iterator; typedef typename _Base::const_iterator _Base_const_iterator; @@ -100,19 +99,19 @@ namespace __debug list(const list& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } list(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ list(list&& __x) noexcept - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } list(initializer_list<value_type> __l, const allocator_type& __a = allocator_type()) - : _Base(__l, __a), _Safe_base() { } + : _Base(__l, __a) { } #endif ~list() _GLIBCXX_NOEXCEPT { } @@ -395,7 +394,7 @@ namespace __debug insert(iterator __p, initializer_list<value_type> __l) { __glibcxx_check_insert(__p); - _Base::insert(__p, __l); + _Base::insert(__p.base(), __l); } #endif diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h index 9f80251e3ae..e80c1e3b4b7 100644 --- a/libstdc++-v3/include/debug/map.h +++ b/libstdc++-v3/include/debug/map.h @@ -46,7 +46,6 @@ namespace __debug public __gnu_debug::_Safe_sequence<map<_Key, _Tp, _Compare, _Allocator> > { typedef _GLIBCXX_STD_C::map<_Key, _Tp, _Compare, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence<map> _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; @@ -61,9 +60,9 @@ namespace __debug typedef typename _Base::reference reference; typedef typename _Base::const_reference const_reference; - typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, map> + typedef __gnu_debug::_Safe_iterator<_Base_iterator, map> iterator; - typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator, map> + typedef __gnu_debug::_Safe_iterator<_Base_const_iterator, map> const_iterator; typedef typename _Base::size_type size_type; @@ -85,24 +84,24 @@ namespace __debug : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, __last)), __gnu_debug::__base(__last), - __comp, __a), _Safe_base() { } + __comp, __a) { } map(const map& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } map(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ map(map&& __x) noexcept(is_nothrow_copy_constructible<_Compare>::value) - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } map(initializer_list<value_type> __l, const _Compare& __c = _Compare(), const allocator_type& __a = allocator_type()) - : _Base(__l, __c, __a), _Safe_base() { } + : _Base(__l, __c, __a) { } #endif ~map() _GLIBCXX_NOEXCEPT { } @@ -206,7 +205,6 @@ namespace __debug std::pair<iterator, bool> insert(const value_type& __x) { - typedef typename _Base::iterator _Base_iterator; std::pair<_Base_iterator, bool> __res = _Base::insert(__x); return std::pair<iterator, bool>(iterator(__res.first, this), __res.second); @@ -219,7 +217,6 @@ namespace __debug std::pair<iterator, bool> insert(_Pair&& __x) { - typedef typename _Base::iterator _Base_iterator; std::pair<_Base_iterator, bool> __res = _Base::insert(std::forward<_Pair>(__x)); return std::pair<iterator, bool>(iterator(__res.first, this), @@ -384,7 +381,6 @@ namespace __debug std::pair<iterator,iterator> equal_range(const key_type& __x) { - typedef typename _Base::iterator _Base_iterator; std::pair<_Base_iterator, _Base_iterator> __res = _Base::equal_range(__x); return std::make_pair(iterator(__res.first, this), @@ -394,7 +390,6 @@ namespace __debug std::pair<const_iterator,const_iterator> equal_range(const key_type& __x) const { - typedef typename _Base::const_iterator _Base_const_iterator; std::pair<_Base_const_iterator, _Base_const_iterator> __res = _Base::equal_range(__x); return std::make_pair(const_iterator(__res.first, this), @@ -411,7 +406,6 @@ namespace __debug void _M_invalidate_all() { - typedef typename _Base::const_iterator _Base_const_iterator; typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal; this->_M_invalidate_if(_Not_equal(_M_base().end())); } diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h index b3c43b8bfa2..cf18d7cc114 100644 --- a/libstdc++-v3/include/debug/multimap.h +++ b/libstdc++-v3/include/debug/multimap.h @@ -47,7 +47,6 @@ namespace __debug _Compare, _Allocator> > { typedef _GLIBCXX_STD_C::multimap<_Key, _Tp, _Compare, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence<multimap> _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; @@ -89,21 +88,21 @@ namespace __debug __comp, __a) { } multimap(const multimap& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } multimap(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ multimap(multimap&& __x) noexcept(is_nothrow_copy_constructible<_Compare>::value) - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } multimap(initializer_list<value_type> __l, const _Compare& __c = _Compare(), const allocator_type& __a = allocator_type()) - : _Base(__l, __c, __a), _Safe_base() { } + : _Base(__l, __c, __a) { } #endif ~multimap() _GLIBCXX_NOEXCEPT { } diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h index ee4c04735dd..9f510000d4d 100644 --- a/libstdc++-v3/include/debug/multiset.h +++ b/libstdc++-v3/include/debug/multiset.h @@ -46,7 +46,6 @@ namespace __debug public __gnu_debug::_Safe_sequence<multiset<_Key, _Compare, _Allocator> > { typedef _GLIBCXX_STD_C::multiset<_Key, _Compare, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence<multiset> _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; @@ -88,21 +87,21 @@ namespace __debug __comp, __a) { } multiset(const multiset& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } multiset(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ multiset(multiset&& __x) noexcept(is_nothrow_copy_constructible<_Compare>::value) - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } multiset(initializer_list<value_type> __l, const _Compare& __comp = _Compare(), const allocator_type& __a = allocator_type()) - : _Base(__l, __comp, __a), _Safe_base() { } + : _Base(__l, __comp, __a) { } #endif ~multiset() _GLIBCXX_NOEXCEPT { } diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h index fd6a607d013..9846ec865f9 100644 --- a/libstdc++-v3/include/debug/set.h +++ b/libstdc++-v3/include/debug/set.h @@ -46,7 +46,6 @@ namespace __debug public __gnu_debug::_Safe_sequence<set<_Key, _Compare, _Allocator> > { typedef _GLIBCXX_STD_C::set<_Key, _Compare, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence<set> _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; @@ -88,21 +87,21 @@ namespace __debug __comp, __a) { } set(const set& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } set(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ set(set&& __x) noexcept(is_nothrow_copy_constructible<_Compare>::value) - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } set(initializer_list<value_type> __l, const _Compare& __comp = _Compare(), const allocator_type& __a = allocator_type()) - : _Base(__l, __comp, __a), _Safe_base() { } + : _Base(__l, __comp, __a) { } #endif ~set() _GLIBCXX_NOEXCEPT { } @@ -206,7 +205,6 @@ namespace __debug std::pair<iterator, bool> insert(value_type&& __x) { - typedef typename _Base::iterator _Base_iterator; std::pair<_Base_iterator, bool> __res = _Base::insert(std::move(__x)); return std::pair<iterator, bool>(iterator(__res.first, this), diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string index 9e0ad61bdef..7856b240b86 100644 --- a/libstdc++-v3/include/debug/string +++ b/libstdc++-v3/include/debug/string @@ -75,12 +75,12 @@ namespace __gnu_debug { } // Provides conversion from a release-mode string to a debug-mode string - basic_string(const _Base& __base) : _Base(__base), _Safe_base() { } + basic_string(const _Base& __base) : _Base(__base) { } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 42. string ctors specify wrong default allocator basic_string(const basic_string& __str) - : _Base(__str, 0, _Base::npos, __str.get_allocator()), _Safe_base() + : _Base(__str, 0, _Base::npos, __str.get_allocator()) { } // _GLIBCXX_RESOLVE_LIB_DEFECTS diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index 7a4265c7b0d..4f087b75992 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -89,25 +89,25 @@ namespace __debug : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, __last)), __gnu_debug::__base(__last), __n, - __hf, __eql, __a), _Safe_base() { } + __hf, __eql, __a) { } unordered_map(const unordered_map& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_map(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_map(unordered_map&& __x) noexcept(__and_<is_nothrow_copy_constructible<_Hash>, is_nothrow_copy_constructible<_Pred>>::value) - : _Base(std::move(__x)), _Safe_base() { } + : _Base(std::move(__x)) { } unordered_map(initializer_list<value_type> __l, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + : _Base(__l, __n, __hf, __eql, __a) { } ~unordered_map() noexcept { } @@ -381,25 +381,25 @@ namespace __debug : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, __last)), __gnu_debug::__base(__last), __n, - __hf, __eql, __a), _Safe_base() { } + __hf, __eql, __a) { } unordered_multimap(const unordered_multimap& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_multimap(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_multimap(unordered_multimap&& __x) noexcept(__and_<is_nothrow_copy_constructible<_Hash>, is_nothrow_copy_constructible<_Pred>>::value) - : _Base(std::move(__x)), _Safe_base() { } + : _Base(std::move(__x)) { } unordered_multimap(initializer_list<value_type> __l, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + : _Base(__l, __n, __hf, __eql, __a) { } ~unordered_multimap() noexcept { } diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index 46dff272bb2..c0b245d95a0 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -89,25 +89,25 @@ namespace __debug : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, __last)), __gnu_debug::__base(__last), __n, - __hf, __eql, __a), _Safe_base() { } + __hf, __eql, __a) { } unordered_set(const unordered_set& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_set(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_set(unordered_set&& __x) noexcept(__and_<is_nothrow_copy_constructible<_Hash>, is_nothrow_copy_constructible<_Pred>>::value) - : _Base(std::move(__x)), _Safe_base() { } + : _Base(std::move(__x)) { } unordered_set(initializer_list<value_type> __l, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + : _Base(__l, __n, __hf, __eql, __a) { } ~unordered_set() noexcept { } @@ -370,25 +370,25 @@ namespace __debug : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, __last)), __gnu_debug::__base(__last), __n, - __hf, __eql, __a), _Safe_base() { } + __hf, __eql, __a) { } unordered_multiset(const unordered_multiset& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_multiset(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_multiset(unordered_multiset&& __x) noexcept(__and_<is_nothrow_copy_constructible<_Hash>, is_nothrow_copy_constructible<_Pred>>::value) - : _Base(std::move(__x)), _Safe_base() { } + : _Base(std::move(__x)) { } unordered_multiset(initializer_list<value_type> __l, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + : _Base(__l, __n, __hf, __eql, __a) { } ~unordered_multiset() noexcept { } diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index 1b80974d38c..9d68d007c12 100644 --- a/libstdc++-v3/include/debug/vector +++ b/libstdc++-v3/include/debug/vector @@ -47,7 +47,6 @@ namespace __debug public __gnu_debug::_Safe_sequence<vector<_Tp, _Allocator> > { typedef _GLIBCXX_STD_C::vector<_Tp, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence<vector> _Safe_base; typedef typename _Base::iterator _Base_iterator; typedef typename _Base::const_iterator _Base_const_iterator; @@ -102,15 +101,15 @@ namespace __debug { _M_update_guaranteed_capacity(); } vector(const vector& __x) - : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { } + : _Base(__x), _M_guaranteed_capacity(__x.size()) { } /// Construction from a release-mode vector vector(const _Base& __x) - : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { } + : _Base(__x), _M_guaranteed_capacity(__x.size()) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ vector(vector&& __x) noexcept - : _Base(std::move(__x)), _Safe_base(), + : _Base(std::move(__x)), _M_guaranteed_capacity(this->size()) { this->_M_swap(__x); @@ -119,7 +118,7 @@ namespace __debug vector(initializer_list<value_type> __l, const allocator_type& __a = allocator_type()) - : _Base(__l, __a), _Safe_base(), + : _Base(__l, __a), _M_guaranteed_capacity(__l.size()) { } #endif diff --git a/libstdc++-v3/libsupc++/eh_arm.cc b/libstdc++-v3/libsupc++/eh_arm.cc index f0acb705eb0..e7ba2e54aa0 100644 --- a/libstdc++-v3/libsupc++/eh_arm.cc +++ b/libstdc++-v3/libsupc++/eh_arm.cc @@ -30,10 +30,11 @@ using namespace __cxxabiv1; -// Given the thrown type THROW_TYPE, pointer to a variable containing a -// pointer to the exception object THROWN_PTR_P and a type CATCH_TYPE to -// compare against, return whether or not there is a match and if so, -// update *THROWN_PTR_P. +// Given the thrown type THROW_TYPE, exception object UE_HEADER and a +// type CATCH_TYPE to compare against, return whether or not there is +// a match and if so, update *THROWN_PTR_P to point to either the +// type-matched object, or in the case of a pointer type, the object +// pointed to by the pointer. extern "C" __cxa_type_match_result __cxa_type_match(_Unwind_Exception* ue_header, @@ -41,51 +42,51 @@ __cxa_type_match(_Unwind_Exception* ue_header, bool is_reference __attribute__((__unused__)), void** thrown_ptr_p) { - bool forced_unwind = __is_gxx_forced_unwind_class(ue_header->exception_class); - bool foreign_exception = !forced_unwind && !__is_gxx_exception_class(ue_header->exception_class); - bool dependent_exception = - __is_dependent_exception(ue_header->exception_class); + bool forced_unwind + = __is_gxx_forced_unwind_class(ue_header->exception_class); + bool foreign_exception + = !forced_unwind && !__is_gxx_exception_class(ue_header->exception_class); + bool dependent_exception + = __is_dependent_exception(ue_header->exception_class); __cxa_exception* xh = __get_exception_header_from_ue(ue_header); __cxa_dependent_exception *dx = __get_dependent_exception_from_ue(ue_header); const std::type_info* throw_type; + void *thrown_ptr = 0; if (forced_unwind) throw_type = &typeid(abi::__forced_unwind); else if (foreign_exception) throw_type = &typeid(abi::__foreign_exception); - else if (dependent_exception) - throw_type = __get_exception_header_from_obj - (dx->primaryException)->exceptionType; else - throw_type = xh->exceptionType; - - void* thrown_ptr = *thrown_ptr_p; + { + if (dependent_exception) + xh = __get_exception_header_from_obj (dx->primaryException); + throw_type = xh->exceptionType; + // We used to require the caller set the target of thrown_ptr_p, + // but that's incorrect -- the EHABI makes no such requirement + // -- and not all callers will set it. Fortunately callers that + // do initialize will always pass us the value we calculate + // here, so there's no backwards compatibility problem. + thrown_ptr = __get_object_from_ue (ue_header); + } + + __cxa_type_match_result result = ctm_succeeded; // Pointer types need to adjust the actual pointer, not // the pointer to pointer that is the exception object. // This also has the effect of passing pointer types // "by value" through the __cxa_begin_catch return value. if (throw_type->__is_pointer_p()) - thrown_ptr = *(void**) thrown_ptr; + { + thrown_ptr = *(void**) thrown_ptr; + // We need to indicate the indirection to our caller. + result = ctm_succeeded_with_ptr_to_base; + } if (catch_type->__do_catch(throw_type, &thrown_ptr, 1)) { *thrown_ptr_p = thrown_ptr; - - if (typeid(*catch_type) == typeid (typeid(void*))) - { - const __pointer_type_info *catch_pointer_type = - static_cast<const __pointer_type_info *> (catch_type); - const __pointer_type_info *throw_pointer_type = - static_cast<const __pointer_type_info *> (throw_type); - - if (typeid (*catch_pointer_type->__pointee) != typeid (void) - && (*catch_pointer_type->__pointee != - *throw_pointer_type->__pointee)) - return ctm_succeeded_with_ptr_to_base; - } - - return ctm_succeeded; + return result; } return ctm_failed; |