diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-09-10 21:16:45 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-09-10 21:16:45 +0000 |
commit | 953b9eef1d0b6b72c78fba6764fbec551a8755ae (patch) | |
tree | 82afde61b11343ec4a2a7d15853c6b4675dc34d6 /gcc/fortran/interface.c | |
parent | 1aef7c3ce205a370900ef25b4ea256f65468c60d (diff) |
2016-09-10 Paul Thomas <pault@gcc.gnu.org>
Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77532
^ interface.c (check_dtio_arg_TKR_intent): Return after error.
(check_dtio_interface1): Remove asserts, test for NULL and return
if found.
gfortran.dg/dtio_11.f90: new test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240074 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index fece3168dc75..45a9afe56856 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -4559,8 +4559,11 @@ check_dtio_arg_TKR_intent (gfc_symbol *fsym, bool typebound, bt type, int kind, int rank, sym_intent intent) { if (fsym->ts.type != type) - gfc_error ("DTIO dummy argument at %L must be of type %s", - &fsym->declared_at, gfc_basic_typename (type)); + { + gfc_error ("DTIO dummy argument at %L must be of type %s", + &fsym->declared_at, gfc_basic_typename (type)); + return; + } if (fsym->ts.type != BT_CLASS && fsym->ts.type != BT_DERIVED && fsym->ts.kind != kind) @@ -4606,20 +4609,23 @@ check_dtio_interface1 (gfc_symbol *derived, gfc_symtree *tb_io_st, { /* Typebound DTIO binding. */ tb_io_proc = tb_io_st->n.tb; - gcc_assert (tb_io_proc != NULL); + if (tb_io_proc == NULL) + return; + gcc_assert (tb_io_proc->is_generic); gcc_assert (tb_io_proc->u.generic->next == NULL); specific_proc = tb_io_proc->u.generic->specific; - gcc_assert (!specific_proc->is_generic); + if (specific_proc == NULL || specific_proc->is_generic) + return; dtio_sub = specific_proc->u.specific->n.sym; } else { generic_proc = tb_io_st->n.sym; - gcc_assert (generic_proc); - gcc_assert (generic_proc->generic); + if (generic_proc == NULL || generic_proc->generic == NULL) + return; for (intr = tb_io_st->n.sym->generic; intr; intr = intr->next) { |