Re: [PATCH] asan: Don't fold some strlens with -fsanitize=address [PR110676]

2024-02-06 Thread Richard Biener
On Tue, 6 Feb 2024, Jakub Jelinek wrote: > Hi! > > The UB on the following testcase isn't diagnosed by -fsanitize=address, > because we see that the array has a single element and optimize the > strlen to 0. I think it is fine to assume e.g. for range purposes the > lower bound for the strlen

[PATCH] asan: Don't fold some strlens with -fsanitize=address [PR110676]

2024-02-06 Thread Jakub Jelinek
Hi! The UB on the following testcase isn't diagnosed by -fsanitize=address, because we see that the array has a single element and optimize the strlen to 0. I think it is fine to assume e.g. for range purposes the lower bound for the strlen as long as we don't try to optimize strlen (str) where