https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104571
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2022-02-16
Status|UNCONFIRMED |NEW
CC| |kargl at gcc dot gnu.org
Ever confirmed|0 |1
Priority|P3 |P4
--- 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..83c895b079e 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -2380,8 +2382,9 @@ resolve_elemental_actual (gfc_expr *expr, gfc_code *c)
if (rank > 0 && esym && expr == NULL)
for (eformal = esym->formal, arg = arg0; arg && eformal;
arg = arg->next, eformal = eformal->next)
- if ((eformal->sym->attr.intent == INTENT_OUT
- || eformal->sym->attr.intent == INTENT_INOUT)
+ if (eformal->sym
+ && (eformal->sym->attr.intent == INTENT_OUT
+ || eformal->sym->attr.intent == INTENT_INOUT)
&& arg->expr && arg->expr->rank == 0)
{
gfc_error ("Actual argument at %L for INTENT(%s) dummy %qs of "