From 9beb81edce130f7f272478285433e27ff608cda5 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Mon, 26 Sep 2016 11:15:23 +0000 Subject: [PATCH] re PR fortran/48298 ([F03] User-Defined Derived-Type IO (DTIO)) 2016-09-26 Paul Thomas PR fortran/48298 * interface.c (gfc_find_specific_dtio_proc) : Return NULL if the derived type is broken, as indicated by a flavor other than FL_DERIVED. From-SVN: r240493 --- gcc/fortran/ChangeLog | 9 ++++++++- gcc/fortran/interface.c | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index dee19ded241..d721bdf9746 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2016-09-26 Paul Thomas + + PR fortran/48298 + * interface.c (gfc_find_specific_dtio_proc) : Return NULL if + the derived type is broken, as indicated by a flavor other than + FL_DERIVED. + 2016-09-26 Marek Polacek PR c/7652 @@ -12,7 +19,7 @@ 2016-09-25 Steven G. Kargl - PR fortran/77429 + PR fortran/77429 * dependency.c (gfc_check_dependency): Convert gcc_assert() to a conditional and possible call to gfc_internal_error(). diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 9a19fa731b0..9a0ccf81185 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -4793,6 +4793,9 @@ gfc_find_specific_dtio_proc (gfc_symbol *derived, bool write, bool formatted) gfc_typebound_proc *tb_io_proc, *specific_proc; bool t = false; + if (!derived || derived->attr.flavor != FL_DERIVED) + return NULL; + /* Try to find a typebound DTIO binding. */ if (formatted == true) { -- 2.30.2