aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2016-09-26 11:15:23 +0000
committerPaul Thomas <pault@gcc.gnu.org>2016-09-26 11:15:23 +0000
commit9beb81edce130f7f272478285433e27ff608cda5 (patch)
tree3f4e6b9ce013aac66a384abedf9c3d3d5d3f9990 /gcc/fortran/interface.c
parent3282420874458112fcf9c8664548ffc27613ccb7 (diff)
downloadgcc-9beb81edce130f7f272478285433e27ff608cda5.zip
gcc-9beb81edce130f7f272478285433e27ff608cda5.tar.gz
gcc-9beb81edce130f7f272478285433e27ff608cda5.tar.bz2
re PR fortran/48298 ([F03] User-Defined Derived-Type IO (DTIO))
2016-09-26 Paul Thomas <pault@gcc.gnu.org> 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
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 9a19fa7..9a0ccf8 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)
{