From: Martin Sebor Date: Tue, 31 Aug 2021 17:16:37 +0000 (-0600) Subject: Avoid valid Coverity warning for comparing array to zero. X-Git-Tag: basepoints/gcc-13~5045 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3aa3288a958a75744df256d70e7f8e90ccab724;p=thirdparty%2Fgcc.git Avoid valid Coverity warning for comparing array to zero. * gimple-ssa-warn-access.cc (maybe_warn_alloc_args_overflow): Test pointer element for equality to zero, not that of the cotaining array. --- diff --git a/gcc/gimple-ssa-warn-access.cc b/gcc/gimple-ssa-warn-access.cc index 5df97a6473a0..5a359587ed38 100644 --- a/gcc/gimple-ssa-warn-access.cc +++ b/gcc/gimple-ssa-warn-access.cc @@ -2433,7 +2433,7 @@ maybe_warn_alloc_args_overflow (gimple *stmt, const tree args[2], } } - if (!argrange[0]) + if (!argrange[0][0]) return; /* For a two-argument alloc_size, validate the product of the two