From owner-svn-src-stable-9@FreeBSD.ORG Mon Aug 11 20:37:04 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E8C0BF9 for ; Mon, 11 Aug 2014 20:37:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42FEB2101 for ; Mon, 11 Aug 2014 20:37:04 +0000 (UTC) Received: from dim (uid 1236) (envelope-from dim@FreeBSD.org) id 2ad9 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 20:37:04 +0000 From: Dimitry Andric Date: Mon, 11 Aug 2014 20:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r269836 - in stable: 10/contrib/libc++/include 9/contrib/libc++/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e92970.2ad9.121cacc3@svn.freebsd.org> X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2014 20:37:04 -0000 Author: dim Date: Mon Aug 11 20:37:03 2014 New Revision: 269836 URL: http://svnweb.freebsd.org/changeset/base/269836 Log: MFC r269740: Pull in r214736 from upstream libc++ trunk (by Marshall Clow): Fix PR#20520 - predicate called too many times in list::remove_if. Add tests for list, forward_list, and the std::remove_if algorithm This fixes an issue where std::list<>::remove_if() and remove() could erroneously visit elements twice. Reported by: Dominic Fandrey PR: 192303 Modified: stable/9/contrib/libc++/include/list Directory Properties: stable/9/contrib/libc++/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/libc++/include/list Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/libc++/include/list ============================================================================== --- stable/9/contrib/libc++/include/list Mon Aug 11 20:36:09 2014 (r269835) +++ stable/9/contrib/libc++/include/list Mon Aug 11 20:37:03 2014 (r269836) @@ -2046,6 +2046,8 @@ list<_Tp, _Alloc>::remove(const value_ty for (; __j != __e && *__j == __x; ++__j) ; __i = erase(__i, __j); + if (__i != __e) + __i = _VSTD::next(__i); } else ++__i; @@ -2065,6 +2067,8 @@ list<_Tp, _Alloc>::remove_if(_Pred __pre for (; __j != __e && __pred(*__j); ++__j) ; __i = erase(__i, __j); + if (__i != __e) + __i = _VSTD::next(__i); } else ++__i;