[Bug analyzer/94362] False analyzer report due to i >= 0 and i < 0 on openssl

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 26 14:43:23 GMT 2022


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

--- Comment #6 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:e966a508e03fe28bfca65a1e60e579fa90355ea6

commit r12-6875-ge966a508e03fe28bfca65a1e60e579fa90355ea6
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Jan 25 11:35:24 2022 -0500

    analyzer: fix sense in range::add_bound [PR94362]

    Mikael Morin spotted that I got the sense wrong when discarding
    redundant constraints in
    r12-6782-gc4b8f3730a80025192fdb485ad2535c165340e41.

    Fixed as follows, which also moves the rejection of contradictory
    constraints in range::add_bound to earlier, so that this code can
    be self-tested.

    gcc/analyzer/ChangeLog:
            PR analyzer/94362
            * constraint-manager.cc (range::add_bound): Fix tests for
            discarding redundant constraints.  Perform test for rejecting
            unsatisfiable constraints earlier so that they don't update
            the object on failure.
            (selftest::test_range): New.
            (selftest::test_constant_comparisons): Add test coverage for
            existing constraints becoming narrower until they are
            unsatisfiable.
            (selftest::run_constraint_manager_tests): Call test_range.

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


More information about the Gcc-bugs mailing list