public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug analyzer/94816] ICE: Segmentation fault (in ana::region_model::add_region_for_type) since r10-5950-g757bf1dff5e8cee3
Date: Tue, 28 Apr 2020 17:26:45 +0000	[thread overview]
Message-ID: <bug-94816-4-J3cgGYQn5a@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94816-4@http.gcc.gnu.org/bugzilla/>

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

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

commit r10-8015-g5eae0ac76dcb6aac1d1d6c4edd8852e0035792e4
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Apr 28 10:52:45 2020 -0400

    analyzer: fix ICE copying struct [PR 94816]

    PR analyzer/94816 reports an ICE when attempting to copy a struct
    containing a field for which add_region_for_type for fails (on
    an OFFSET_TYPE): the region for the src field comes from
    make_region_for_unexpected_tree_code which gives it a NULL type, and
    then the copy calls add_region_for_type which unconditionally
    dereferences the NULL type.

    This patch fixes the ICE by checking for NULL types in
    add_region_for_type.

    gcc/analyzer/ChangeLog:
            PR analyzer/94816
            * engine.cc (impl_region_model_context::on_unexpected_tree_code):
            Handle NULL tree.
            * region-model.cc (region_model::add_region_for_type): Handle
            NULL type.
            * region-model.h
            (test_region_model_context::on_unexpected_tree_code): Handle NULL
            tree.

    gcc/testsuite/ChangeLog:
            PR analyzer/94816
            * g++.dg/analyzer/pr94816.C: New test.

  parent reply	other threads:[~2020-04-28 17:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 12:21 [Bug analyzer/94816] New: ICE: Segmentation fault (in ana::region_model::add_region_for_type) asolokha at gmx dot com
2020-04-28 14:15 ` [Bug analyzer/94816] ICE: Segmentation fault (in ana::region_model::add_region_for_type) since r10-5950-g757bf1dff5e8cee3 marxin at gcc dot gnu.org
2020-04-28 17:26 ` cvs-commit at gcc dot gnu.org [this message]
2020-04-28 17:55 ` dmalcolm at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94816-4-J3cgGYQn5a@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).