This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: deque bug
Phil Edwards wrote:
> On Fri, Nov 16, 2001 at 12:43:57PM +0100, Levente Farkas wrote:
> > hi,
> > the same bug exists in libstdc++-v3 in line 887:
> > http://www.stlport.com/dcforum/DCForumID6/645.html
> > I'm lazy to make a patch:-(((
>
> "line 887" doesn't help. Which file, which function, and which CVS branch?
Levente is obviously right, IMHO, and the problem is present in both the mainline and the
gcc-3.0 branch.
This is a patch against the mainline:
Paolo Carlini <pcarlini@unitus.it>
* include/bits/stl_deque.h (deque::erase()): Fix memory leak.
--- stl_deque.h.orig Fri Nov 16 14:22:52 2001
+++ stl_deque.h Fri Nov 16 14:43:22 2001
@@ -900,7 +900,7 @@
copy_backward(_M_start, __first, __last);
iterator __new_start = _M_start + __n;
_Destroy(_M_start, __new_start);
- _M_destroy_nodes(__new_start._M_node, _M_start._M_node);
+ _M_destroy_nodes(_M_start._M_node, __new_start._M_node);
_M_start = __new_start;
}
else {