aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2014-04-15 11:52:06 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2014-04-15 11:52:06 +0100
commit4b3f98299462007a9bb8cdd349c2d59bee0eaf44 (patch)
tree56a501907480f490480311c75a24ebe0d470cfc3
parentd8e4ce6d853bcad54c57a1eb7d69ebfd88311d05 (diff)
downloadgcc-4b3f98299462007a9bb8cdd349c2d59bee0eaf44.zip
gcc-4b3f98299462007a9bb8cdd349c2d59bee0eaf44.tar.gz
gcc-4b3f98299462007a9bb8cdd349c2d59bee0eaf44.tar.bz2
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
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/stl_tree.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 54ec30e..e11f1a9 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-15 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/60734
+ * include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast.
+
2014-04-14 Jonathan Wakely <jwakely@redhat.com>
* 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 4bc3c60..288c9fa 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)