This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libstdc++/1089: ios_base::_M_grow_words(int ix) SEGV's w/fix



>Number:         1089
>Category:       libstdc++
>Synopsis:       ios_base::_M_grow_words(int ix) SEGV's w/fix
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 18 13:26:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Curtis Janssen
>Release:        gcc version 2.97 20001213 (experimental)
>Organization:
>Environment:
SuSE 7.0; glibc 2.1.3; linux 2.2.16
>Description:
Attached test code, ofs.cc, SEGV's when run.
>How-To-Repeat:
% c++ -O0 -g    ofs.cc   -o ofs
% ./ofs
>Fix:
Index: ios.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/ios.cc,v
retrieving revision 1.7
diff -u -r1.7 ios.cc
--- ios.cc      2000/11/23 04:53:40     1.7
+++ ios.cc      2000/12/18 21:24:15
@@ -220,7 +220,7 @@
            // _M_clear(_M_rdstate() | badbit);  // may throw
            return _M_dummy;
          }
-       do { words[i] = _M_words[i]; } while (++i < _M_word_limit);
+       for (; i < _M_word_limit; i++) { words[i] = _M_words[i]; }
        if (_M_words != _M_word_array) delete [] _M_words;
       }
     
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="ofs.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="ofs.cc"

CiNpbmNsdWRlIDxmc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKbWFpbigpCnsKICBsb25n
IHgxID0gaW9zOjp4YWxsb2MoKTsKICBsb25nIHgyID0gaW9zOjp4YWxsb2MoKTsKICBsb25nIHgz
ID0gaW9zOjp4YWxsb2MoKTsKICBsb25nIHg0ID0gaW9zOjp4YWxsb2MoKTsKCiAgY29uc3QgY2hh
ciAqZmlsZW5hbWUgPSAib2ZzLnRlc3Qub3V0IjsKICBvZnN0cmVhbSBvdXQoZmlsZW5hbWUpOwog
IG91dCA8PCAiTGluZSAiIDw8IDEgPDwgZW5kbDsKICByZXR1cm4gMDsKfQoK

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]