analyzer: fix missing uninit warning on args to stdio builtins [PR104224]
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 25 Jan 2022 19:10:46 +0000 (14:10 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 26 Jan 2022 14:43:43 +0000 (09:43 -0500)
commit9ff3e2368d86c1bf7d1e8876a14e58c0d6617ffe
tree90324c572a9807d18792fae1ee9d8029aa875206
parente966a508e03fe28bfca65a1e60e579fa90355ea6
analyzer: fix missing uninit warning on args to stdio builtins [PR104224]

We were failing to check for uninitialized arguments to stdio builtins,
such as when passing local "go" to the call to "printf" in "main" in
the testcase.

gcc/analyzer/ChangeLog:
PR analyzer/104224
* region-model.cc (region_model::check_call_args): New.
(region_model::on_call_pre): Call it when ignoring stdio builtins.
* region-model.h (region_model::check_call_args): New decl

gcc/testsuite/ChangeLog:
PR analyzer/104224
* gcc.dg/analyzer/pr104224.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/analyzer/region-model.cc
gcc/analyzer/region-model.h
gcc/testsuite/gcc.dg/analyzer/pr104224.c [new file with mode: 0644]