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

--- Comment #2 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:5e10b9a28be9061b9b0c4aa3cfabe6d478e444e0

commit r10-6410-g5e10b9a28be9061b9b0c4aa3cfabe6d478e444e0
Author: David Malcolm <dmalc...@redhat.com>
Date:   Mon Feb 3 08:30:54 2020 -0500

    analyzer: fix ICE merging models containing label pointers (PR 93546)

    PR analyzer/93546 reports an ICE within region_model::add_region_for_type
    when merging two region_models each containing a label pointer.  The
    two labels are stored as pointers to symbolic_regions, but these regions
    were created with NULL type, leading to an assertion failure when a
    merged copy is created.

    The labels themselves have void (but not NULL) type.

    This patch updates make_region_for_type to use the type of the decl when
    creating such regions, rather than implicitly setting the region's type
    to NULL, fixing the ICE.

    gcc/analyzer/ChangeLog:
        PR analyzer/93546
        * region-model.cc (region_model::on_call_pre): Update for new
        param of symbolic_region ctor.
        (region_model::deref_rvalue): Likewise.
        (region_model::add_new_malloc_region): Likewise.
        (make_region_for_type): Likewise, preserving type.
        * region-model.h (symbolic_region::symbolic_region): Add "type"
        param and pass it to base class ctor.

    gcc/testsuite/ChangeLog:
        PR analyzer/93546
        * gcc.dg/analyzer/pr93546.c: New test.

Reply via email to