From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11811 invoked by alias); 22 Jan 2003 16:46:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 11787 invoked by uid 71); 22 Jan 2003 16:46:00 -0000 Resent-Date: 22 Jan 2003 16:46:00 -0000 Resent-Message-ID: <20030122164600.11786.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, peturr02@ru.is Received: (qmail 8711 invoked by uid 48); 22 Jan 2003 16:41:37 -0000 Message-Id: <20030122164137.8710.qmail@sources.redhat.com> Date: Wed, 22 Jan 2003 16:46:00 -0000 From: peturr02@ru.is Reply-To: peturr02@ru.is To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/9404: stringbuf::sputc doesn't call overflow if output buffer full X-SW-Source: 2003-01/txt/msg01206.txt.bz2 List-Id: >Number: 9404 >Category: libstdc++ >Synopsis: stringbuf::sputc doesn't call overflow if output buffer full >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Jan 22 16:46:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: peturr02@ru.is >Release: gcc-3.2.1 >Organization: >Environment: Red Hat Linux 8.0 >Description: If sb is an instance of a class derived from stringbuf and sb.pptr() == sb.epptr(), calling sb.sputc does not cause overflow to be called. >How-To-Repeat: See attachment. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="sputcbug.cc" Content-Disposition: inline; filename="sputcbug.cc" #include using namespace std; bool called = false; class Derived_stringbuf : public stringbuf { public: int_type overflow(int_type c) { called = true; return stringbuf::overflow(c); } const char_type* pub_epptr() const { return epptr(); } const char_type* pub_pptr() const { return pptr(); } }; int main() { Derived_stringbuf dsbuf; dsbuf.sputc('c'); assert(called); assert(dsbuf.pub_epptr() == dsbuf.pub_pptr()); called = false; dsbuf.sputc('a'); assert(called); return 0; }