This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] tile: Check for pointer add overflow in memchr



On 12/01/2017 19:37, Chris Metcalf wrote:
> +  /* Handle possible addition overflow.  */
> +  if (__glibc_unlikely ((unsigned long) last_byte_ptr < (unsigned long) s))
> +    last_byte_ptr = (const char *) UINTPTR_MAX;
> +

Wouldn't a branchfree saturating addition be better for tile?


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