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 via email to