From: John Bytheway Date: Tue, 6 Nov 2018 20:20:06 +0000 (+0000) Subject: re PR libstdc++/87872 (debug list::splice should not call _M_transfer_from_if on... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cdc71993cf6d210bc7ff5b9c1ec099c25a8c5f48;p=gcc.git re PR libstdc++/87872 (debug list::splice should not call _M_transfer_from_if on self-splices) 2018-11-06 John Bytheway PR libstdc++/87872 * include/debug/safe_sequence.tcc (_Safe_sequence<>::_M_transfer_from_if): Skip transfer to self. From-SVN: r265851 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b7126f8283c..fe28f52bc77 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2018-11-06 John Bytheway + + PR libstdc++/87872 + * include/debug/safe_sequence.tcc + (_Safe_sequence<>::_M_transfer_from_if): Skip transfer to self. + 2018-10-31 Joseph Myers PR bootstrap/82856 diff --git a/libstdc++-v3/include/debug/safe_sequence.tcc b/libstdc++-v3/include/debug/safe_sequence.tcc index 12de48cf322..ce9a807e79f 100644 --- a/libstdc++-v3/include/debug/safe_sequence.tcc +++ b/libstdc++-v3/include/debug/safe_sequence.tcc @@ -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;