Commit 40109581 by Janus Weil

re PR fortran/78592 (ICE in gfc_find_specific_dtio_proc, at fortran/interface.c:4939)

2016-11-30  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/78592
	* interface.c (gfc_find_specific_dtio_proc): Rearrange code to avoid
	dereferencing a null pointer.

2016-11-30  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/78592
	* gfortran.dg/dtio_18.f90: New test case.

From-SVN: r243005
parent 0bdad123
2016-11-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/78592
* interface.c (gfc_find_specific_dtio_proc): Rearrange code to avoid
dereferencing a null pointer.
2016-11-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/78573
* decl.c (build_struct): On error, return directly and do not build
class symbol.
......
......@@ -4933,15 +4933,15 @@ gfc_find_specific_dtio_proc (gfc_symbol *derived, bool write, bool formatted)
&& tb_io_st->n.sym
&& tb_io_st->n.sym->generic)
{
gfc_interface *intr;
for (intr = tb_io_st->n.sym->generic; intr; intr = intr->next)
for (gfc_interface *intr = tb_io_st->n.sym->generic;
intr && intr->sym && intr->sym->formal;
intr = intr->next)
{
gfc_symbol *fsym = intr->sym->formal->sym;
if (intr->sym && intr->sym->formal
&& ((fsym->ts.type == BT_CLASS
&& CLASS_DATA (fsym)->ts.u.derived == extended)
|| (fsym->ts.type == BT_DERIVED
&& fsym->ts.u.derived == extended)))
if ((fsym->ts.type == BT_CLASS
&& CLASS_DATA (fsym)->ts.u.derived == extended)
|| (fsym->ts.type == BT_DERIVED
&& fsym->ts.u.derived == extended))
{
dtio_sub = intr->sym;
break;
......
2016-11-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/78592
* gfortran.dg/dtio_18.f90: New test case.
2016-11-30 Martin Liska <mliska@suse.cz>
PR sanitizer/78541
......
! { dg-do compile }
!
! PR 78592: [7 Regression] ICE in gfc_find_specific_dtio_proc, at fortran/interface.c:4939
!
! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
program p
type t
end type
type(t) :: z
interface write(formatted)
module procedure wf ! { dg-error "is neither function nor subroutine" }
end interface
print *, z
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment