https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111266

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalc...@gcc.gnu.org>:

https://gcc.gnu.org/g:617bd59c659dcf6e5391409a2e9f64f75e905a96

commit r14-9018-g617bd59c659dcf6e5391409a2e9f64f75e905a96
Author: David Malcolm <dmalc...@redhat.com>
Date:   Thu Feb 15 16:01:36 2024 -0500

    analyzer: remove offset_region size overloads [PR111266]

    PR analyzer/111266 reports a missing -Wanalyzer-out-of-bounds when
    accessing relative to a concrete byte offset.

    Root cause is that offset_region::get_{byte,bit}_size_sval were
    attempting to compute the size that's valid to access, rather than the
    size of the access attempt.

    Fixed by removing these vfunc overrides from offset_region as the
    base class implementation does the right thing.

    gcc/analyzer/ChangeLog:
            PR analyzer/111266
            * region.cc (offset_region::get_byte_size_sval): Delete.
            (offset_region::get_bit_size_sval): Delete.
            * region.h (region::get_byte_size): Add comment clarifying that
            this relates to the size of the access, rather than the size
            that's valid to access.
            (region::get_bit_size): Likewise.
            (region::get_byte_size_sval): Likewise.
            (region::get_bit_size_sval): Likewise.
            (offset_region::get_byte_size_sval): Delete.
            (offset_region::get_bit_size_sval): Delete.

    gcc/testsuite/ChangeLog:
            PR analyzer/111266
            * c-c++-common/analyzer/out-of-bounds-pr111266.c: New test.

    Signed-off-by: David Malcolm <dmalc...@redhat.com>

Reply via email to