From issues-return-653-apmail-stdcxx-issues-archive=stdcxx.apache.org@stdcxx.apache.org Mon Mar 17 14:43:11 2008 Return-Path: Delivered-To: apmail-stdcxx-issues-archive@locus.apache.org Received: (qmail 76524 invoked from network); 17 Mar 2008 14:43:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Mar 2008 14:43:11 -0000 Received: (qmail 15353 invoked by uid 500); 17 Mar 2008 14:43:09 -0000 Delivered-To: apmail-stdcxx-issues-archive@stdcxx.apache.org Received: (qmail 15334 invoked by uid 500); 17 Mar 2008 14:43:09 -0000 Mailing-List: contact issues-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list issues@stdcxx.apache.org Received: (qmail 15316 invoked by uid 99); 17 Mar 2008 14:43:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Mar 2008 07:43:09 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Mar 2008 14:42:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 55A9B234C0A0 for ; Mon, 17 Mar 2008 07:41:27 -0700 (PDT) Message-ID: <1732468586.1205764887350.JavaMail.jira@brutus> Date: Mon, 17 Mar 2008 07:41:27 -0700 (PDT) From: "Farid Zaripov (JIRA)" To: issues@stdcxx.apache.org Subject: [jira] Updated: (STDCXX-438) std::string::append (InputIterator, InputIterator) appending self incorrect MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Farid Zaripov updated STDCXX-438: --------------------------------- Fix Version/s: (was: 4.3) 4.2.1 > std::string::append (InputIterator, InputIterator) appending self incorrect > --------------------------------------------------------------------------- > > Key: STDCXX-438 > URL: https://issues.apache.org/jira/browse/STDCXX-438 > Project: C++ Standard Library > Issue Type: Bug > Components: 21. Strings > Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0 > Environment: all > Reporter: Martin Sebor > Assignee: Farid Zaripov > Priority: Minor > Fix For: 4.2.1 > > Original Estimate: 8h > Remaining Estimate: 8h > > The 21.string.append.cpp test has been failing a number of assertions for self-referential test cases that exercise the ability to append a substring of a string into itself using the append(InputIterator, InputIterator) member template specialization for InputIterator being an actual Input Iterator. The program below reproduces the problem in a small isolated test case. > {noformat} > $ cat t.cpp && gmake t && ./t > #include > #include > #include > #include > #include > #include > void* operator new (std::size_t n) throw (std::bad_alloc) > { > void* const ptr = std::malloc (n + sizeof n); > std::memset (ptr, -1, n); > *(std::size_t*)ptr = n; > return (std::size_t*)ptr + 1; > } > void operator delete (void *ptr) throw () > { > std::memset (ptr, -1, *((std::size_t*)ptr - 1)); > std::free ((std::size_t*)ptr - 1); > > } > struct InputIterator: std::iterator > { > const char *p_; > InputIterator (const char *p): p_ (p) { } > char operator* () const { return *p_; } > InputIterator& operator++ () { return ++p_, *this; } > InputIterator operator++ (int) { > return ++p_, InputIterator (p_ - 1); > } > bool operator== (const InputIterator &rhs) const { return p_ == rhs.p_; } > }; > int main () > { > const char s[] = "abc"; > { > std::string str (s); > const char* p0 = s + 1; > const char* p1 = p0 + 1; > const InputIterator first (p0); > const InputIterator last (p1); > str.append (first, last); > assert ("abcb" == str); > } > { > std::string str (s); > const char* p0 = str.data () + 1; > const char* p1 = p0 + 1; > const InputIterator first (p0); > const InputIterator last (p1); > str.append (first, last); > assert ("abcb" == str); > } > } > aCC -c -I/amd/devco/sebor/stdcxx/include/ansi -I/usr/include -D_RWSTDDEBUG -mt -D_RWSTD_USE_CONFIG -I/amd/devco/sebor/stdcxx/include -I/build/sebor/stdcxx-aCC-3.73-15D/include -I/amd/devco/sebor/stdcxx/tests/include -Aa +nostl -g +d +DD64 +w +W392 +W655 +W684 +W818 +W819 +W849 t.cpp > aCC t.o -o t -L/build/sebor/stdcxx-aCC-3.73-15D/rwtest -lrwtest15D -Aa +nostl -Wl,+s -Wl,+vnocompatwarnings -mt +DD64 -L/build/sebor/stdcxx-aCC-3.73-15D/lib -Wl,+b/build/sebor/stdcxx-aCC-3.73-15D/lib:/build/sebor/stdcxx-aCC-3.73-15D/rwtest -lstd15D -lm > Assertion failed: "abcb" == str, file t.cpp, line 67 > ABORT instruction (core dumped) > {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.