Patch committed: Fix erasing with reference in old hashtable code

Ian Lance Taylor iant@google.com
Wed May 25 23:09:00 GMT 2011


This patch fixes a problem with the old hashtable::erase code when the
caller passes a reference to an element in the table, the element is not
the first in the bucket, but it is equal to the first in the bucket.
This is PR 49060, and the patch and test case are from that PR with
minor tweaks.  Bootstrapped and ran libstdc++ testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian


2011-05-25  David Tardon  <dtardon@redhat.com>

	PR libstdc++/49060
	* include/backward/hashtable.h (hashtable::erase): Don't crash if
	erasing first and another element with a reference to the other
	element.
	* testsuite/backward/hash_set/49060.cc: New.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 1996 bytes
Desc: patc
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20110525/b3359931/attachment.bin>


More information about the Libstdc++ mailing list