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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:cc078cf85295ec5d0a63a16afbd045efac0d455e

commit r13-1855-gcc078cf85295ec5d0a63a16afbd045efac0d455e
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Jul 27 12:04:50 2022 +0200

    opts: Add an assertion to help static analyzers [PR106332]

    This function would have UB if called with empty candidates vector
    (accessing p[-1] where p is malloc (0) result).
    As analyzed in the PR, we never call it with empty vector, so this just
    adds an assertion to make it clear.

    2022-07-27  Jakub Jelinek  <ja...@redhat.com>

            PR middle-end/106332
            * opts-common.cc (candidates_list_and_hint): Add gcc_assert
            that candidates is not an empty vector.

Reply via email to