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: "caj at cs dot york dot ac dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Sep 2004 11:41:01 -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 caj at cs dot york dot ac dot uk 2004-09-05 11:40 -------
This problem seems to go deeper than just list::remove.
As an example, given
A[]={0,1,0,1,0,1,0,1};
then
std::remove(A,A+8,1) and std::remove(A,A+8,*(A+1)) produce different output, as
the second one will start removing different elements once the value of A[1] is
changed while the algorithm is running.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17012