From patchwork Sat Feb 19 20:53:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fran=C3=A7ois_Dumont?= X-Patchwork-Id: 83714 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 13BE3B7164 for ; Sun, 20 Feb 2011 07:54:00 +1100 (EST) Received: (qmail 32755 invoked by alias); 19 Feb 2011 20:53:56 -0000 Received: (qmail 32581 invoked by uid 22791); 19 Feb 2011 20:53:55 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp6-g21.free.fr (HELO smtp6-g21.free.fr) (212.27.42.6) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 19 Feb 2011 20:53:44 +0000 Received: from localhost.localdomain (unknown [82.237.250.248]) by smtp6-g21.free.fr (Postfix) with ESMTP id CA1B88228D; Sat, 19 Feb 2011 21:53:35 +0100 (CET) Message-ID: <4D602DCE.1000400@free.fr> Date: Sat, 19 Feb 2011 21:53:34 +0100 From: =?ISO-8859-1?Q?Fran=E7ois_Dumont?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101213 Mandriva/3.0.11-0.1mdv2010.1 (2010.1) Thunderbird/3.0.11 MIME-Version: 1.0 To: Paolo Carlini CC: "libstdc++@gcc.gnu.org" , gcc-patches@gcc.gnu.org Subject: Re: debug mode patch References: <4D5F9AD5.8020404@free.fr> In-Reply-To: Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 02/19/2011 12:42 PM, Paolo Carlini wrote: > Hi, > > >> Hi >> >> Here is a proposition of a patch to a minor issue in debug string and to remove a useless debug check on heap. Ok ? >> > Looks good, thanks! > > Paolo. > Attached patch applied 2011-02-19 François Dumont * include/debug/string (basic_string::insert): Add iterator check and pass normal iterator to normal insert. * include/debug/macros.h (__glibcxx_check_heap, __glibcxx_check_heap_pred): Remove __glibcxx_check_valid_range, already done. Bests Index: include/debug/string =================================================================== --- include/debug/string (revision 170309) +++ include/debug/string (working copy) @@ -514,7 +514,8 @@ void insert(iterator __p, std::initializer_list<_CharT> __l) { - _Base::insert(__p, __l); + __glibcxx_check_insert(__p); + _Base::insert(__p.base(), __l); this->_M_invalidate_all(); } #endif // __GXX_EXPERIMENTAL_CXX0X__ Index: include/debug/macros.h =================================================================== --- include/debug/macros.h (revision 170309) +++ include/debug/macros.h (working copy) @@ -286,7 +286,6 @@ // Verify that the iterator range [_First, _Last) is a heap #define __glibcxx_check_heap(_First,_Last) \ -__glibcxx_check_valid_range(_First,_Last); \ _GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last), \ _M_message(__gnu_debug::__msg_not_heap) \ ._M_iterator(_First, #_First) \ @@ -295,7 +294,6 @@ /** Verify that the iterator range [_First, _Last) is a heap w.r.t. the predicate _Pred. */ #define __glibcxx_check_heap_pred(_First,_Last,_Pred) \ -__glibcxx_check_valid_range(_First,_Last); \ _GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last, _Pred), \ _M_message(__gnu_debug::__msg_not_heap_pred) \ ._M_iterator(_First, #_First) \