This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] tile: Check for pointer add overflow in memchr
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Fri, 13 Jan 2017 08:42:56 -0200
- Subject: Re: [PATCH] tile: Check for pointer add overflow in memchr
- Authentication-results: sourceware.org; auth=none
- References: <1484257047-25513-1-git-send-email-cmetcalf@mellanox.com>
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?