[PATCH] tile: Check for pointer add overflow in memchr

Adhemerval Zanella adhemerval.zanella@linaro.org
Fri Jan 13 10:43:00 GMT 2017



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?



More information about the Libc-alpha mailing list