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

--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
(In reply to Jerry DeLisle from comment #4)
> (In reply to Steve Kargl from comment #3)
> > (In reply to Steve Kargl from comment #2)
> > > It's a null pointer dereference at expr:1197.
> > 
> > This fixes the issue.  Note, patch is against gcc 15 branch
> > do line numbers are off.
> > 
> > diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc
> > index 04f0c513a7d..847066ce45a 100644
> > --- a/gcc/fortran/expr.cc
> > +++ b/gcc/fortran/expr.cc
> > @@ -1193,7 +1193,7 @@ is_CFI_desc (gfc_symbol *sym, gfc_expr *e)
> >        && e && e->expr_type == EXPR_VARIABLE)
> >      sym = e->symtree->n.sym;
> >  
> > -  if (sym && sym->attr.dummy
> > +  if (sym && sym->attr.dummy && sym->ns && sym->ns->proc_name
> >        && sym->ns->proc_name->attr.is_bind_c
> >        && (sym->attr.pointer
> >           || sym->attr.allocatable
> 
> Seems simple enough, I can commit for you if needed.

So, do you want to do the honors?

Reply via email to