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/106626] Improvements to wording of -Wanalyzer-out-of-bounds
Date: Thu, 01 Dec 2022 02:31:28 +0000	[thread overview]
Message-ID: <bug-106626-4-EypHYW9eVb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106626-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from CVS 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:df460cf51b25868564dd2628a399b8c874ef309c

commit r13-4428-gdf460cf51b25868564dd2628a399b8c874ef309c
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Wed Nov 30 21:26:42 2022 -0500

    analyzer: more bounds-checking wording tweaks [PR106626]

    This patch tweaks the wording of -Wanalyzer-out-of-bounds:

    * use the spellings/terminology of CWE:
      * replace "underread" with "under-read", as per:
         https://cwe.mitre.org/data/definitions/127.html
      * replace "overread" with "over-read" as per:
         https://cwe.mitre.org/data/definitions/126.html
      * replace "underflow" with "underwrite" as per:
        https://cwe.mitre.org/data/definitions/124.html

    * wherever known, specify the memory region of the bad access,
    so that it says e.g. "heap-based buffer over-read"
    or "stack-based buffer over-read"

    gcc/analyzer/ChangeLog:
            PR analyzer/106626
            * bounds-checking.cc (out_of_bounds::get_memory_space): New.
            (buffer_overflow::emit): Use it.
            (class buffer_overread): Rename to...
            (class buffer_over_read): ...this.
            (buffer_over_read::emit): Specify which memory space the read is
            from, where known.  Change "overread" to "over-read".
            (class buffer_underflow): Rename to...
            (class buffer_underwrite): ...this.
            (buffer_underwrite::emit): Specify which memory space the write is
            to, where known.  Change "underflow" to "underwrite".
            (class buffer_underread): Rename to...
            (class buffer_under_read): Rename to...
            (buffer_under_read::emit): Specify which memory space the read is
            from, where known.  Change "underread" to "under-read".
            (symbolic_past_the_end::get_memory_space): New.
            (symbolic_buffer_overflow::emit): Use it.
            (class symbolic_buffer_overread): Rename to...
            (class symbolic_buffer_over_read): ...this.
            (symbolic_buffer_over_read::emit): Specify which memory space the
            read is from, where known.  Change "overread" to "over-read".
            (region_model::check_symbolic_bounds): Update for class renaming.
            (region_model::check_region_bounds): Likewise.

    gcc/testsuite/ChangeLog:
            PR analyzer/106626
            * gcc.dg/analyzer/call-summaries-2.c: Update expected results.
            * gcc.dg/analyzer/out-of-bounds-1.c: Likewise.
            * gcc.dg/analyzer/out-of-bounds-2.c: Likewise.
            * gcc.dg/analyzer/out-of-bounds-3.c: Likewise.
            * gcc.dg/analyzer/out-of-bounds-4.c: Likewise.
            * gcc.dg/analyzer/out-of-bounds-5.c: Likewise.
            * gcc.dg/analyzer/out-of-bounds-container_of.c: Likewise.
            * gcc.dg/analyzer/out-of-bounds-read-char-arr.c: Likewise.  Rename
            functions from "int_arr_" to "char_arr_".
            * gcc.dg/analyzer/out-of-bounds-read-int-arr.c: Update expected
            results.
            * gcc.dg/analyzer/out-of-bounds-read-struct-arr.c: New test.
            * gcc.dg/analyzer/out-of-bounds-write-char-arr.c: Update expected
            results.  Rename functions from "int_arr_" to "char_arr_".
            * gcc.dg/analyzer/out-of-bounds-write-int-arr.c: Update expected
            results.
            * gcc.dg/analyzer/out-of-bounds-write-struct-arr.c: New test.
            * gcc.dg/analyzer/pr101962.c: Update expected results.
            * gcc.dg/analyzer/realloc-5.c: Update expected results.
            * gcc.dg/analyzer/zlib-3.c: Update expected results.

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

  parent reply	other threads:[~2022-12-01  2:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15 13:08 [Bug analyzer/106626] New: " dmalcolm at gcc dot gnu.org
2022-08-15 18:48 ` [Bug analyzer/106626] " cvs-commit at gcc dot gnu.org
2022-12-01  2:31 ` cvs-commit at gcc dot gnu.org
2022-12-01  2:31 ` cvs-commit at gcc dot gnu.org
2022-12-01  2:31 ` cvs-commit at gcc dot gnu.org [this message]
2022-12-01  2:31 ` cvs-commit at gcc dot gnu.org
2022-12-01  2:31 ` cvs-commit at gcc dot gnu.org
2023-04-07 12:36 ` dmalcolm at gcc dot gnu.org
2023-06-22  2:06 ` cvs-commit 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-106626-4-EypHYW9eVb@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).