Commit fba5a793 by Steven G. Kargl

re PR fortran/78500 (ICE in gfc_check_vardef_context, at fortran/expr.c:5289)

2016-11-24  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78500
	* expr.c (gfc_check_vardef_contextm): Fix NULL pointer dereference.
	* interface.c (matching_typebound_op): Ditto.

2016-11-24  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78500
	* gfortran.dg/class_result_4.f90: New test.

From-SVN: r242846
parent 11e554b3
2016-11-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78500
* expr.c (gfc_check_vardef_contextm): Fix NULL pointer dereference.
* interface.c (matching_typebound_op): Ditto.
2016-11-23 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78297
......
......@@ -5291,7 +5291,8 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
component. Note that (normal) assignment to procedure pointers is not
possible. */
check_intentin = !own_scope;
ptr_component = (sym->ts.type == BT_CLASS && CLASS_DATA (sym))
ptr_component = (sym->ts.type == BT_CLASS && sym->ts.u.derived
&& CLASS_DATA (sym))
? CLASS_DATA (sym)->attr.class_pointer : sym->attr.pointer;
for (ref = e->ref; ref && check_intentin; ref = ref->next)
{
......
......@@ -3885,7 +3885,7 @@ matching_typebound_op (gfc_expr** tb_base,
if (base->expr->ts.type == BT_CLASS)
{
if (CLASS_DATA (base->expr) == NULL
if (!base->expr->ts.u.derived || CLASS_DATA (base->expr) == NULL
|| !gfc_expr_attr (base->expr).class_ok)
continue;
derived = CLASS_DATA (base->expr)->ts.u.derived;
......
2016-11-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78500
* gfortran.dg/class_result_4.f90: New test.
2016-11-24 James Greenhalgh <james.greenhalgh@arm.com>
* gcc.target/aarch64/_Float16_1.c: New.
......
! { dg-do compile }
! PR fortran/78500
class(t) function f() ! { dg-error "must be dummy, allocatable or pointer" }
f = 1 ! { dg-error "variable must not be polymorphic" }
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