public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug analyzer/111266] [13/14 Regression] Missing -Wanalyzer-out-of-bounds for concrete offset overwrite.
Date: Thu, 15 Feb 2024 21:02:51 +0000	[thread overview]
Message-ID: <bug-111266-4-KgYGmeuhQG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111266-4@http.gcc.gnu.org/bugzilla/>

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 <dmalcolm@gcc.gnu.org>:

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

commit r14-9018-g617bd59c659dcf6e5391409a2e9f64f75e905a96
Author: David Malcolm <dmalcolm@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 <dmalcolm@redhat.com>

  parent reply	other threads:[~2024-02-15 21:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01  9:56 [Bug analyzer/111266] New: " vultkayn at gcc dot gnu.org
2024-02-15 14:42 ` [Bug analyzer/111266] [13/14 Regression] " dmalcolm at gcc dot gnu.org
2024-02-15 21:02 ` cvs-commit at gcc dot gnu.org [this message]
2024-02-15 21:07 ` [Bug analyzer/111266] [13 " dmalcolm at gcc dot gnu.org
2024-04-14  5:06 ` pinskia at gcc dot gnu.org
2024-05-13 11:30 ` rguenth at gcc dot gnu.org
2024-05-21  9:16 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-111266-4-KgYGmeuhQG@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).