On Mon, Apr 20, 2020 at 11:29 PM Martin Sebor via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> The restrict pass computes the wrong lower bound of the size
> of accesses to member arrays passed to strncpy as the source:
> it uses the third argument to the function even though the size
> of the read is limited by the length of the source when it is
> a string.  This results in false positive -Warray-bounds
> warnings in such cases.
>
> The attached patch corrects this bug.  In addition, it adjusts
> the range of offsets of the overlap printed in diagnostics to
> be in an increasing order (i.e., [LOW, HIGH]), and removes
> a hack was in place to adjust the offsets that's obviated by
> the fix above.
>
> Tested on x86_64-linux.

OK.

Richard.

> Martin

Reply via email to