[patch] libstdc++/59603 Prevent self-swapping in random_shuffle

Jonathan Wakely jwakely.gcc@gmail.com
Sat Dec 6 22:04:00 GMT 2014


On 1 October 2014 at 13:35, Jonathan Wakely <jwakely@redhat.com> wrote:
> On 12/09/14 14:34 +0100, Jonathan Wakely wrote:
>>
>> Swapping an object with itself is pointless, and asserts in debug mode
>> (but we should probably remove that check from debug mode, since it
>> can happen in reasonable code).
>>
>> Tested x86_64-linux, committed to trunk.
>>
>> I think this makes sense for the branches too, so will backport it
>> soon.
>
>
> Now committed to the 4.9 branch (without the comment Chris didn't
> like).
>
>>         PR libstdc++/59603
>>         * include/bits/stl_algo.h (random_shuffle): Prevent self-swapping.
>>         * testsuite/25_algorithms/random_shuffle/59603.cc: New.
>
>
>

And also to the 4.8 branch.



More information about the Gcc-patches mailing list