Commit aea18e92 by Janus Weil

re PR fortran/44584 (Invalid memory access with gfortran.dg/typebound_proc_15.f03)

2010-08-03  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/44584
	PR fortran/45161
	* class.c (add_procs_to_declared_vtab1): Don't add erroneous procedures.
	* resolve.c (resolve_tb_generic_targets): Check for errors.


2010-08-03  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/44584
	PR fortran/45161
	* gfortran.dg/typebound_call_9.f03: Modified.
	* gfortran.dg/typebound_generic_1.f03: Modified.

From-SVN: r162840
parent 1890bccc
2010-08-03 Janus Weil <janus@gcc.gnu.org>
PR fortran/44584
PR fortran/45161
* class.c (add_procs_to_declared_vtab1): Don't add erroneous procedures.
* resolve.c (resolve_tb_generic_targets): Check for errors.
2010-08-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45159
......
......@@ -257,10 +257,8 @@ add_procs_to_declared_vtab1 (gfc_symtree *st, gfc_symbol *vtype)
if (st->right)
add_procs_to_declared_vtab1 (st->right, vtype);
if (!st->n.tb)
return;
if (!st->n.tb->is_generic && st->n.tb->u.specific)
if (st->n.tb && !st->n.tb->error
&& !st->n.tb->is_generic && st->n.tb->u.specific)
add_proc_comp (vtype, st->name, st->n.tb);
}
......
......@@ -10261,7 +10261,7 @@ resolve_tb_generic_targets (gfc_symbol* super_type,
target_name = target->specific_st->name;
/* Defined for this type directly. */
if (target->specific_st->n.tb)
if (target->specific_st->n.tb && !target->specific_st->n.tb->error)
{
target->specific = target->specific_st->n.tb;
goto specific_found;
......
2010-08-03 Janus Weil <janus@gcc.gnu.org>
PR fortran/44584
PR fortran/45161
* gfortran.dg/typebound_call_9.f03: Modified.
* gfortran.dg/typebound_generic_1.f03: Modified.
2010-08-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45159
......
......@@ -17,7 +17,7 @@ module foo_mod
contains
procedure, pass(a) :: makenull ! { dg-error "has no argument 'a'" }
generic :: null2 => makenull
generic :: null2 => makenull ! { dg-error "Undefined specific binding" }
end type base_foo_type
......@@ -50,7 +50,7 @@ contains
endif
call a%makenull()
call a%null2 () ! { dg-error "no matching specific binding" }
call a%null2 () ! { dg-error "should be a SUBROUTINE" }
Return
End Subroutine foo_free
......
......@@ -18,7 +18,7 @@ MODULE m
GENERIC :: gen1 => p1a ! { dg-error "are ambiguous" }
GENERIC, PUBLIC :: gen1 => p1, p2
GENERIC :: gen1 => p3 ! Implicitelly PUBLIC.
GENERIC :: gen1 => p3 ! Implicitly PUBLIC.
GENERIC, PRIVATE :: gen2 => p1
GENERIC :: gen2 => p2 ! { dg-error "same access" }
......@@ -29,7 +29,8 @@ MODULE m
GENERIC :: gen3 => ! { dg-error "specific binding" }
GENERIC :: gen4 => p1 x ! { dg-error "Junk after" }
GENERIC :: gen5 => p_notthere ! { dg-error "Undefined specific binding" }
GENERIC :: gen6 => gen1 ! { dg-error "must target a specific binding" }
GENERIC :: gen6 => p1
GENERIC :: gen7 => gen6 ! { dg-error "must target a specific binding" }
GENERIC :: gensubr => p2 ! { dg-error "mixed FUNCTION/SUBROUTINE" }
GENERIC :: gensubr => subr
......
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