public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/104554] ICE in check_assumed_size_reference, at fortran/resolve.cc:1650
Date: Tue, 15 Feb 2022 21:42:32 +0000	[thread overview]
Message-ID: <bug-104554-4-YQktIzEfVl@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104554-4@http.gcc.gnu.org/bugzilla/>

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-02-15
           Priority|P3                          |P4
     Ever confirmed|0                           |1

--- Comment #1 from kargl at gcc dot gnu.org ---
NULL pointer dereference.

diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index 835a4783718..51162455cbb 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -1647,7 +1647,9 @@ check_assumed_size_reference (gfc_symbol *sym, gfc_expr
*e)

   /* FIXME: The comparison "e->ref->u.ar.type == AR_FULL" is wrong.
      What should it be?  */
-  if (e->ref && (e->ref->u.ar.end[e->ref->u.ar.as->rank - 1] == NULL)
+  if (e->ref
+      && e->ref->u.ar.as
+      && (e->ref->u.ar.end[e->ref->u.ar.as->rank - 1] == NULL)
          && (e->ref->u.ar.as->type == AS_ASSUMED_SIZE)
               && (e->ref->u.ar.type == AR_FULL))
     {

  reply	other threads:[~2022-02-15 21:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 19:39 [Bug fortran/104554] New: " gscfq@t-online.de
2022-02-15 21:42 ` kargl at gcc dot gnu.org [this message]
2022-02-24 11:22 ` [Bug fortran/104554] " marxin at gcc dot gnu.org
2023-02-15 19:59 ` anlauf at gcc dot gnu.org
2023-02-15 21:23 ` cvs-commit at gcc dot gnu.org
2023-02-16 17:30 ` cvs-commit at gcc dot gnu.org
2023-02-16 17:32 ` anlauf 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-104554-4-YQktIzEfVl@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).