[Bug libstdc++/47921] pbump will overflow when input n is larger than 2G-1

2011-02-28 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47921 Paolo Carlini changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|

[Bug libstdc++/47921] pbump will overflow when input n is larger than 2G-1

2011-02-28 Thread paolo at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47921 --- Comment #8 from paolo at gcc dot gnu.org 2011-02-28 23:51:02 UTC --- Author: paolo Date: Mon Feb 28 23:50:57 2011 New Revision: 170579 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170579 Log: 2011-02-28 Paolo Carlini PR libs

[Bug libstdc++/47921] pbump will overflow when input n is larger than 2G-1

2011-02-28 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47921 --- Comment #7 from Paolo Carlini 2011-02-28 14:11:39 UTC --- Actually, fixing strstream too is easy, because it derives from basic_streambuf, which can be assumed to have __safe_pbump

[Bug libstdc++/47921] pbump will overflow when input n is larger than 2G-1

2011-02-28 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47921 Paolo Carlini changed: What|Removed |Added Status|RESOLVED|REOPENED Last reconfirmed|

[Bug libstdc++/47921] pbump will overflow when input n is larger than 2G-1

2011-02-28 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47921 Paolo Carlini changed: What|Removed |Added CC||jwakely.gcc at gmail dot

[Bug libstdc++/47921] pbump will overflow when input n is larger than 2G-1

2011-02-28 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47921 --- Comment #4 from Jonathan Wakely 2011-02-28 12:43:41 UTC --- something like this (untested) --- include/std/streambuf.orig 2011-02-28 12:40:44.559350898 + +++ include/std/streambuf 2011-02-28 12:32:20.445685621 + @@ -38,6 +38,7

[Bug libstdc++/47921] pbump will overflow when input n is larger than 2G-1

2011-02-28 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47921 --- Comment #3 from Jonathan Wakely 2011-02-28 12:36:28 UTC --- We can't change the signature of pbump, but that doesn't mean we have to call it with values that cause overflow. Could we add a safe_pbump(streamsize n) which calls pbump in a loop

[Bug libstdc++/47921] pbump will overflow when input n is larger than 2G-1

2011-02-28 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47921 Paolo Carlini changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|

[Bug libstdc++/47921] pbump will overflow when input n is larger than 2G-1

2011-02-28 Thread RobertPython at 163 dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47921 --- Comment #1 from Robert Python 2011-02-28 10:51:30 UTC --- try below program in a 64bit environment with about 8G memory: #include #include #include #define N 1 #define SIZE 40 using namespace std; int main() { const cha