re PR libstdc++/87872 (debug list::splice should not call _M_transfer_from_if on...
authorJohn Bytheway <jbytheway@gmail.com>
Tue, 6 Nov 2018 20:20:06 +0000 (20:20 +0000)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Tue, 6 Nov 2018 20:20:06 +0000 (20:20 +0000)
2018-11-06  John Bytheway  <jbytheway@gmail.com>

PR libstdc++/87872
* include/debug/safe_sequence.tcc
(_Safe_sequence<>::_M_transfer_from_if): Skip transfer to self.

From-SVN: r265851

libstdc++-v3/ChangeLog
libstdc++-v3/include/debug/safe_sequence.tcc

index b7126f8..fe28f52 100644 (file)
@@ -1,3 +1,9 @@
+2018-11-06  John Bytheway  <jbytheway@gmail.com>
+
+       PR libstdc++/87872
+       * include/debug/safe_sequence.tcc
+       (_Safe_sequence<>::_M_transfer_from_if): Skip transfer to self.
+
 2018-10-31  Joseph Myers  <joseph@codesourcery.com>
 
        PR bootstrap/82856
index 12de48c..ce9a807 100644 (file)
@@ -68,6 +68,9 @@ namespace __gnu_debug
       _Safe_sequence<_Sequence>::
       _M_transfer_from_if(_Safe_sequence& __from, _Predicate __pred)
       {
+       if (this == std::__addressof(__from))
+         return;
+
        typedef typename _Sequence::iterator iterator;
        typedef typename _Sequence::const_iterator const_iterator;