diff options
author | David Malcolm <dmalcolm@redhat.com> | 2024-06-07 16:14:29 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2024-06-07 16:14:29 -0400 |
commit | 70f26314b62e2d636b1f2d3db43e75abb026e535 (patch) | |
tree | 410b7a85d985f678745d4cd82c3ed68d31543b80 /libcpp | |
parent | 13dcaf1bb6d4f15665a47b14ac0c12cf454e38a2 (diff) | |
download | gcc-70f26314b62e2d636b1f2d3db43e75abb026e535.zip gcc-70f26314b62e2d636b1f2d3db43e75abb026e535.tar.gz gcc-70f26314b62e2d636b1f2d3db43e75abb026e535.tar.bz2 |
analyzer: eliminate cast_region::m_original_region
cast_region had its own field m_original_region, rather than
simply using region::m_parent, leading to lots of pointless
special-casing of RK_CAST.
Remove the field and simply use the parent region.
Doing so revealed a bug (seen in gcc.dg/analyzer/taint-alloc-4.c)
where region_model::get_representative_path_var_1's RK_CAST case
was always failing, due to using the "parent region" (actually
that of the original region's parent), rather than the original region;
the patch fixes the bug by removing the distinction.
gcc/analyzer/ChangeLog:
* call-summary.cc
(call_summary_replay::convert_region_from_summary_1): Update
for removal of cast_region::m_original_region.
* region-model-manager.cc
(region_model_manager::get_or_create_initial_value): Likewise.
* region-model.cc (region_model::get_store_value): Likewise.
* region.cc (region::get_base_region): Likewise.
(region::descendent_of_p): Likewise.
(region::maybe_get_frame_region): Likewise.
(region::get_memory_space): Likewise.
(region::calc_offset): Likewise.
(cast_region::accept): Delete.
(cast_region::dump_to_pp): Update for removal of
cast_region::m_original_region.
(cast_region::add_dump_widget_children): Delete.
* region.h (struct cast_region::key_t): Rename "original_region"
to "parent".
(cast_region::cast_region): Likewise. Update for removal of
cast_region::m_original_region.
(cast_region::accept): Delete.
(cast_region::add_dump_widget_children): Delete.
(cast_region::get_original_region): Delete.
(cast_region::m_original_region): Delete.
* sm-taint.cc (region_model::check_region_for_taint): Remove
special-casing for RK_CAST.
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/taint-alloc-4.c: Update expected result to
reflect change in message due to
region_model::get_representative_path_var_1 now handling RK_CAST.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions