public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-9355] analyzer: better fix for -Wanalyzer-use-of-uninitialized-value [PR106573]
@ 2023-03-29 18:18 David Malcolm
0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2023-03-29 18:18 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:c63e5a234d0193e1f41024cf0eee840998e04c7f
commit r12-9355-gc63e5a234d0193e1f41024cf0eee840998e04c7f
Author: David Malcolm <dmalcolm@redhat.com>
Date: Wed Mar 29 14:16:46 2023 -0400
analyzer: better fix for -Wanalyzer-use-of-uninitialized-value [PR106573]
Cherrypicked from r13-2053-gca123e019bb92f.
gcc/analyzer/ChangeLog:
PR analyzer/106573
* region-model.cc (region_model::on_call_pre): Use check_call_args
when ensuring that we call get_arg_svalue on all args. Remove
redundant call from handling for stdio builtins.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diff:
---
gcc/analyzer/region-model.cc | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc
index f4c05baf60e..bfee042c08f 100644
--- a/gcc/analyzer/region-model.cc
+++ b/gcc/analyzer/region-model.cc
@@ -1359,8 +1359,7 @@ region_model::on_call_pre (const gcall *call, region_model_context *ctxt,
duplicates if any of the handling below also looks up the svalues,
but the deduplication code should deal with that. */
if (ctxt)
- for (unsigned arg_idx = 0; arg_idx < cd.num_args (); arg_idx++)
- cd.get_arg_svalue (arg_idx);
+ check_call_args (cd);
/* Some of the cases below update the lhs of the call based on the
return value, but not all. Provide a default value, which may
@@ -1477,7 +1476,6 @@ region_model::on_call_pre (const gcall *call, region_model_context *ctxt,
/* These stdio builtins have external effects that are out
of scope for the analyzer: we only want to model the effects
on the return value. */
- check_call_args (cd);
break;
}
else if (is_named_call_p (callee_fndecl, "malloc", call, 1))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-29 18:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29 18:18 [gcc r12-9355] analyzer: better fix for -Wanalyzer-use-of-uninitialized-value [PR106573] David Malcolm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).