]> git.ipfire.org Git - thirdparty/gcc.git/commit
analyzer: add ctxt to fill_region/zero_fill_region
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 6 Sep 2023 13:31:56 +0000 (09:31 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 6 Sep 2023 13:31:56 +0000 (09:31 -0400)
commitb923978a6ec44772a13daf8b8dddfb3333e67bbe
treecf411dc62384b19f02a5569db8828c77f704604e
parent0574a19047fa66f26a38e79c1b9ae6a8207bba89
analyzer: add ctxt to fill_region/zero_fill_region

I noticed that region_model's fill_region/zero_fill_region member
functions weren't checking that the write to the region was valid.

Fixed thusly.

gcc/analyzer/ChangeLog:
* kf.cc (kf_calloc::impl_call_pre): Pass ctxt to zero_fill_region.
(kf_memset::impl_call_pre): Move responsibility for calling
check_region_for_write to fill_region.
* region-model.cc (region_model::on_assignment): Pass ctxt to
zero_fill_region.
(region_model::fill_region): Add "ctxt" param, using it to call
check_region_for_write.
(region_model::zero_fill_region): Likewise.
* region-model.h (region_model::fill_region): Add "ctxt" param.
(region_model::zero_fill_region): Likewise.

gcc/testsuite/ChangeLog:
* gcc.dg/plugin/analyzer_cpython_plugin.c: Pass ctxt to
zero_fill_region.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/analyzer/kf.cc
gcc/analyzer/region-model.cc
gcc/analyzer/region-model.h
gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.c