This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/86281] [9 regression] SEGV in fortran/resolve.c:resolve_function
- From: "kargl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 Jun 2018 18:12:40 +0000
- Subject: [Bug fortran/86281] [9 regression] SEGV in fortran/resolve.c:resolve_function
- Auto-submitted: auto-generated
- References: <bug-86281-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86281
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #4 from kargl at gcc dot gnu.org ---
(In reply to Paul Thomas from comment #3)
> (In reply to Rainer Orth from comment #1)
> > Created attachment 44310 [details]
> > proposed patch
>
> Rainer,
>
> Many, many thanks for taking care of this.
>
> I know what the problem with assumed_charlen_function_7.f90 is all about.
>
> Best regards
>
> Paul
This is probably a a slightly better patch than Rainer's
patch (although checking for a NULL pointer as he has done
is not a bad idea). Watch for cut-n-paste.
Index: resolve.c
===================================================================
--- resolve.c (revision 261908)
+++ resolve.c (working copy)
@@ -3116,6 +3136,7 @@ resolve_function (gfc_expr *expr)
/* If this is a deferred TBP with an abstract interface, its result
cannot be an assumed length character (F2003: C418). */
if (sym && sym->attr.abstract && sym->attr.function
+ && sym->result->ts.type == BT_CHARACTER
&& sym->result->ts.u.cl->length == NULL)
{
gfc_error ("ABSTRACT INTERFACE %qs at %L must not have an assumed "