[patch] libstdc++/66327 don't pass null pointers to memcmp

Jonathan Wakely jwakely@redhat.com
Sat May 30 11:44:00 GMT 2015


On 30/05/15 09:36 +0000, Jörg Richter wrote:
>> >How about comparing only the length against 0?
>> >The pointers must be != 0 if length > 0.
>>
>> Like so? Yes, that's probably an improvement, because we need that
>> length anyway.
>
>Yes, that is what I had in mind.
>I think the second case can be handled equally by
>precomputing std::min(__len1, __len2).

Yep, that's better too, I've tested and committed this patch. Thanks
for the suggestions.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1554 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20150530/14d91b2a/attachment.bin>


More information about the Libstdc++ mailing list