]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Avoid valid Coverity warning for comparing array to zero.
authorMartin Sebor <msebor@redhat.com>
Tue, 31 Aug 2021 17:16:37 +0000 (11:16 -0600)
committerMartin Sebor <msebor@redhat.com>
Tue, 31 Aug 2021 17:16:37 +0000 (11:16 -0600)
* gimple-ssa-warn-access.cc (maybe_warn_alloc_args_overflow): Test
pointer element for equality to zero, not that of the cotaining
array.

gcc/gimple-ssa-warn-access.cc

index 5df97a6473a02f38bdbae076b129963a6b31af54..5a359587ed3868117123fc5c34600629c5df8407 100644 (file)
@@ -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