From: Jonathan Wakely Date: Tue, 15 Apr 2014 10:52:06 +0000 (+0100) Subject: re PR libstdc++/60734 (Undefined behavior in g++-v4/bits/stl_tree.h) X-Git-Tag: releases/gcc-5.1.0~8112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b3f98299462007a9bb8cdd349c2d59bee0eaf44;p=thirdparty%2Fgcc.git re PR libstdc++/60734 (Undefined behavior in g++-v4/bits/stl_tree.h) PR libstdc++/60734 * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast. From-SVN: r209414 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 54ec30e00325..e11f1a9e8711 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2014-04-15 Jonathan Wakely + + PR libstdc++/60734 + * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast. + 2014-04-14 Jonathan Wakely * include/bits/stl_vector.h (_Vector_base::_Vector_impl, diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index 4bc3c602c200..288c9fa4f1e4 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -526,11 +526,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Link_type _M_end() _GLIBCXX_NOEXCEPT - { return static_cast<_Link_type>(&this->_M_impl._M_header); } + { return reinterpret_cast<_Link_type>(&this->_M_impl._M_header); } _Const_Link_type _M_end() const _GLIBCXX_NOEXCEPT - { return static_cast<_Const_Link_type>(&this->_M_impl._M_header); } + { return reinterpret_cast<_Const_Link_type>(&this->_M_impl._M_header); } static const_reference _S_value(_Const_Link_type __x)