libstdc++/51866 too, sorry

François Dumont frs.dumont@gmail.com
Tue Jan 17 21:14:00 GMT 2012


Here is the patch.

2012-01-17  François Dumont <fdumont@gcc.gnu.org>
         Roman Kononov <roman@binarylife.net>

     PR libstdc++/51866
     * include/bits/hashtable.h (_Hashtable<>::_M_insert(_Arg, false_type)):
     Do not keep a reference to a potentially moved instance.
     * testsuite/23_containers/unordered_multiset/insert/51866.cc: New.
     * testsuite/23_containers/unordered_multimap/insert/51866.cc: New.

Tested under linux x86_64 normal, debug and profile modes.

Ok to commit ?

François


On 01/16/2012 09:34 PM, François Dumont wrote:
>     Thanks to this bug report the problem became quite obvious.
>
>     In hashtable implementation I take a const reference to the key 
> part extracted from the passed value and use it even after the value 
> has been moved to generate a node. This problem only impact 
> unordered_multiset and unordere_multimap, the container type 
> referenced in PR 51845.
>
>     I will submit test case and patch by Wednesday, perhaps before 
> that if I can.
>
> François
>
>
> On 01/16/2012 02:48 AM, Paolo Carlini wrote:
>> Hi,
>>
>> I assigned you 51866, the testcase is neat.
>>
>> Thanks,
>> Paolo.
>>
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 51866.patch
Type: text/x-patch
Size: 7377 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20120117/0623361a/attachment.bin>


More information about the Libstdc++ mailing list