rope::[const_]iterator::operator= bug and fix

Kevin Atkinson kevina@clark.net
Tue Sep 1 23:22:00 GMT 1998


There is a big in rope::const_iterator::operator= with incident recursion.

Here is the 1 (well 2 with the comment) line fix based on how SGI 
fixed it in the latest release.  The some bug appears to be in
rope::iterator::operator= however I have not tested it.


*** stl_rope.h~ Fri Feb 20 06:09:09 1998
--- stl_rope.h  Wed Sep  2 01:47:20 1998
***************
*** 702,708 ****
        __rope_iterator_base<charT,Alloc>(r.tree_ptr, pos) {}
      __rope_const_iterator& operator= (const __rope_const_iterator & x) {
        if (0 != x.buf_ptr) {
!           *this = x;
        } else {
            current_pos = x.current_pos;
            root = x.root;
--- 702,709 ----
        __rope_iterator_base<charT,Alloc>(r.tree_ptr, pos) {}
      __rope_const_iterator& operator= (const __rope_const_iterator & x) {
        if (0 != x.buf_ptr) {
!         *(static_cast<__rope_iterator_base<charT,Alloc>*>(this)) = x; 
!         //  *this = x;
        } else {
            current_pos = x.current_pos;
            root = x.root;



More information about the Gcc-patches mailing list