This is the mail archive of the gcc-patches@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]

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


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;


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