This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> >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).

- JÃrg

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]