public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/11460] New: Incorrect use of int_type in strstreambuf::pbackfail
@ 2003-07-08  9:15 peturr02 at ru dot is
  2003-07-08  9:22 ` [Bug libstdc++/11460] " peturr02 at ru dot is
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: peturr02 at ru dot is @ 2003-07-08  9:15 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11460

           Summary: Incorrect use of int_type in strstreambuf::pbackfail
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: peturr02 at ru dot is
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

strstreambuf::pbackfail uses the construct
  else if (c == static_cast<int_type>(gptr()[-1])) 
where c is of type int_type. This always evaluates to false when
gptr()[-1] < 0, since values of int_type that correspond to actual
characters are >= 0. To fix, this should be changed to
  else if (c == static_cast<unsigned char>(gptr()[-1])) 
or, even better
  else if (c == traits_type::to_int_type(gptr()[-1]))


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/11460] Incorrect use of int_type in strstreambuf::pbackfail
  2003-07-08  9:15 [Bug libstdc++/11460] New: Incorrect use of int_type in strstreambuf::pbackfail peturr02 at ru dot is
@ 2003-07-08  9:22 ` peturr02 at ru dot is
  2003-08-24  1:23 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: peturr02 at ru dot is @ 2003-07-08  9:22 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11460



------- Additional Comments From peturr02 at ru dot is  2003-07-08 09:22 -------
Created an attachment (id=4362)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4362&action=view)
Test case

This test case shows that, if _M_constant == true and
c == traits_type::to_int_type(gptr()[-1]), strstreambuf::pbackfail(c) fails
when (char)c < 0, but succeeds when (char)c >= 0. It also shows that sungetc
and sputbackc are not affected by the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/11460] Incorrect use of int_type in strstreambuf::pbackfail
  2003-07-08  9:15 [Bug libstdc++/11460] New: Incorrect use of int_type in strstreambuf::pbackfail peturr02 at ru dot is
  2003-07-08  9:22 ` [Bug libstdc++/11460] " peturr02 at ru dot is
@ 2003-08-24  1:23 ` pinskia at gcc dot gnu dot org
  2003-10-12 19:29 ` paolo at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-24  1:23 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11460


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4                         |---


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/11460] Incorrect use of int_type in strstreambuf::pbackfail
  2003-07-08  9:15 [Bug libstdc++/11460] New: Incorrect use of int_type in strstreambuf::pbackfail peturr02 at ru dot is
  2003-07-08  9:22 ` [Bug libstdc++/11460] " peturr02 at ru dot is
  2003-08-24  1:23 ` pinskia at gcc dot gnu dot org
@ 2003-10-12 19:29 ` paolo at gcc dot gnu dot org
  2003-10-12 20:03 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo at gcc dot gnu dot org @ 2003-10-12 19:29 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11460


paolo at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |paolo at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-10-12 19:29:29
               date|                            |


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/11460] Incorrect use of int_type in strstreambuf::pbackfail
  2003-07-08  9:15 [Bug libstdc++/11460] New: Incorrect use of int_type in strstreambuf::pbackfail peturr02 at ru dot is
                   ` (2 preceding siblings ...)
  2003-10-12 19:29 ` paolo at gcc dot gnu dot org
@ 2003-10-12 20:03 ` cvs-commit at gcc dot gnu dot org
  2003-10-12 20:05 ` paolo at gcc dot gnu dot org
  2004-08-06 16:48 ` cvs-commit at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-10-12 20:03 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11460



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-10-12 20:03 -------
Subject: Bug 11460

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	paolo@gcc.gnu.org	2003-10-12 20:03:19

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/src: strstream.cc 
Added files:
	libstdc++-v3/testsuite/backward: 11460.cc 

Log message:
	2003-10-12  Petur Runolfsson  <peturr02@ru.is>
	Paolo Carlini  <pcarlini@unitus.it>
	
	PR libstdc++/11460
	* src/strstream.cc (pbackfail): Fix to use to_int_type.
	* testsuite/backward/11460.cc: New, from the PR.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2009&r2=1.2010
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/src/strstream.cc.diff?cvsroot=gcc&r1=1.17&r2=1.18
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/backward/11460.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/11460] Incorrect use of int_type in strstreambuf::pbackfail
  2003-07-08  9:15 [Bug libstdc++/11460] New: Incorrect use of int_type in strstreambuf::pbackfail peturr02 at ru dot is
                   ` (3 preceding siblings ...)
  2003-10-12 20:03 ` cvs-commit at gcc dot gnu dot org
@ 2003-10-12 20:05 ` paolo at gcc dot gnu dot org
  2004-08-06 16:48 ` cvs-commit at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: paolo at gcc dot gnu dot org @ 2003-10-12 20:05 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11460


paolo at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.4


------- Additional Comments From paolo at gcc dot gnu dot org  2003-10-12 20:05 -------
Fixed for 3.4.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/11460] Incorrect use of int_type in strstreambuf::pbackfail
  2003-07-08  9:15 [Bug libstdc++/11460] New: Incorrect use of int_type in strstreambuf::pbackfail peturr02 at ru dot is
                   ` (4 preceding siblings ...)
  2003-10-12 20:05 ` paolo at gcc dot gnu dot org
@ 2004-08-06 16:48 ` cvs-commit at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-06 16:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-06 16:48 -------
Subject: Bug 11460

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	hammer-3_3-branch
Changes by:	paolo@gcc.gnu.org	2004-08-06 16:48:23

Modified files:
	libstdc++-v3   : ChangeLog.hammer 
	libstdc++-v3/src: strstream.cc 

Log message:
	2004-08-06  Petur Runolfsson  <peturr02@ru.is>
	Paolo Carlini  <pcarlini@unitus.it>
	
	PR libstdc++/11460
	* src/strstream.cc (pbackfail): Fix to use to_int_type.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.hammer.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.1.2.33&r2=1.1.2.34
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/src/strstream.cc.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.14.6.1&r2=1.14.6.2



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11460


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-08-06 16:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-08  9:15 [Bug libstdc++/11460] New: Incorrect use of int_type in strstreambuf::pbackfail peturr02 at ru dot is
2003-07-08  9:22 ` [Bug libstdc++/11460] " peturr02 at ru dot is
2003-08-24  1:23 ` pinskia at gcc dot gnu dot org
2003-10-12 19:29 ` paolo at gcc dot gnu dot org
2003-10-12 20:03 ` cvs-commit at gcc dot gnu dot org
2003-10-12 20:05 ` paolo at gcc dot gnu dot org
2004-08-06 16:48 ` cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).