This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/17012] std::list's function, remove, looks like it is reading memory that has been freed.
- From: "chris at bubblescope dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jul 2005 12:11:11 -0000
- Subject: [Bug libstdc++/17012] std::list's function, remove, looks like it is reading memory that has been freed.
- References: <20040812195652.17012.debrak@sgi.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From chris at bubblescope dot net 2005-07-05 12:11 -------
It seems to me that this is just a simple NAB. There seems to be 3 options
1) Just leave it as is
2) Alter list::remove so in debug mode it aborts if you give it an element from the list
3) Alter list::remove so this code works (which in some very quick checking seems to produce about a
~15% slowdown on things like list<int>s)
The similar problem on things in <algorithm> I think is more cut (if you pass something by reference to
an algorithm, that algorithm shouldn't change it, clearly). This could still perhaps be made clearer in the
standard...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17012