This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/54296] using the object in the map to erase element from the map crashes
- From: "fdumont at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 27 Aug 2012 07:58:49 +0000
- Subject: [Bug libstdc++/54296] using the object in the map to erase element from the map crashes
- Auto-submitted: auto-generated
- References: <bug-54296-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54296
--- Comment #7 from FranÃois Dumont <fdumont at gcc dot gnu.org> 2012-08-27 07:58:49 UTC ---
I confirm that it is an old issue, it has surely always be there. I managed to
reproduce it from the testsuite. The problem is that the current code works
fine when the key instance is taken from the container keys but doesn't work
when it is extracted from the container values.
The current address check is not reliable because the passed key instance could
be anywhere within the mapped value. I am preparing a patch to separate the
loop used to find the nodes to erase from the loop used to deallocate them.