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

--- Comment #1 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:ce27b66d952127b7abd0f8cceacb79eb6ecf71db

commit r14-7266-gce27b66d952127b7abd0f8cceacb79eb6ecf71db
Author: David Malcolm <dmalc...@redhat.com>
Date:   Mon Jan 15 19:01:21 2024 -0500

    analyzer: fix false +ves from -Wanalyzer-tainted-array-index with unsigned
char index [PR106229]

    gcc/analyzer/ChangeLog:
            PR analyzer/106229
            * analyzer.h (compare_constants): New decl.
            * constraint-manager.cc (compare_constants): Make non-static.
            * sm-taint.cc: Add include "fold-const.h".
            (class concrete_range): New.
            (get_possible_range): New.
            (index_can_be_out_of_bounds_p): New.
            (region_model::check_region_for_taint): Reject
            -Wanalyzer-tainted-array-index if the type of the value makes it
            impossible for it to be out-of-bounds of the array.

    gcc/testsuite/ChangeLog:
            PR analyzer/106229
            * c-c++-common/analyzer/taint-index-pr106229.c: New test.

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

Reply via email to