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

--- Comment #1 from CVS 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:648796dab42b6e839f10fee5835f24cd2016a9f4

commit r10-6182-g648796dab42b6e839f10fee5835f24cd2016a9f4
Author: David Malcolm <dmalc...@redhat.com>
Date:   Wed Jan 22 16:26:38 2020 -0500

    analyzer: avoid ICE with missing arguments (PR 93375)

    PR analyzer/93375 reports an ICE under certain circumstances
    involving a call where the number of arguments at the callsite
    is less than the parameter count of the callee,

    Specifically, the ICE occurs when pruning a checker_path for a
    diagnostic, when attempting to maintain which expression is of
    interest through such a call.

    The root cause is an assumption that there were enough arguments at
    the callsite, within callgraph_superedge's methods for mapping
    expressions between callee and caller.

    This patch adds checks for this to the relevant methods, fixing the ICE.

    gcc/analyzer/ChangeLog:
        PR analyzer/93375
        * supergraph.cc (callgraph_superedge::get_arg_for_parm): Fail
        gracefully is the number of parameters at the callee exceeds the
        number of arguments at the call stmt.
        (callgraph_superedge::get_parm_for_arg): Likewise.

    gcc/testsuite/ChangeLog:
        PR analyzer/93375
        * gcc.dg/analyzer/pr93375.c: New test.

Reply via email to