[Bug libstdc++/63698] [5 Regression] std::set leaks nodes on assignment

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Oct 31 13:40:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yes, it looks like we also need:

--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -423,6 +423,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION

                      while (_M_nodes->_M_right)
                        _M_nodes = _M_nodes->_M_right;
+                     if (_M_nodes->_M_left)
+                       _M_nodes = _M_nodes->_M_left;
                    }
                }
              else // __node is on the left.



More information about the Gcc-bugs mailing list