This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/51845] [4.7 regression] 23_containers/unordered_multimap/erase/24061-multimap.cc segfault
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 18 Jan 2012 20:52:27 +0000
- Subject: [Bug libstdc++/51845] [4.7 regression] 23_containers/unordered_multimap/erase/24061-multimap.cc segfault
- Auto-submitted: auto-generated
- References: <bug-51845-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51845
--- Comment #19 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-18 20:52:27 UTC ---
Other alternatives to fix this would be to add
size_t __prev_bkt = _M_bucket_index(__prev_n);
before the for (;;) loop and change the
if (__n && __n_bkt != __bkt)
test to
if (__n && __prev_bkt != __n_bkt)
or remove the
__is_bucket_begin = true;
line and do instead
__is_bucket_begin = __n_bkt != __bkt;
before the if (__n == __last_n) test and then test just __n &&
__is_bucket_begin after the for (;;) loop. But I think the patch I'm
bootstrapping/regtesting right now is cheaper than that.