re PR fortran/83021 (gfortran segfault in polymorphic assignment)

2017-11-28  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83021
	* resolve.c (resolve_component): Only escape for use assciated
	vtypes if the current namespace has no proc_name and is most
	particularly block data.

From-SVN: r255202
This commit is contained in:
Paul Thomas 2017-11-28 15:13:42 +00:00
parent 4aa458f2ac
commit a964d4b12b
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2017-11-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83021
* resolve.c (resolve_component): Only escape for use assciated
vtypes if the current namespace has no proc_name and is most
particularly block data.
2017-11-28 Jakub Jelinek <jakub@redhat.com>
* trans-decl.c (gfc_trans_entry_master_switch): Build SWITCH_EXPR

View File

@ -13502,7 +13502,11 @@ resolve_component (gfc_component *c, gfc_symbol *sym)
if (c->attr.artificial)
return true;
if (sym->attr.vtype && sym->attr.use_assoc)
/* Do not allow vtype components to be resolved in nameless namespaces
such as block data because the procedure pointers will cause ICEs
and vtables are not needed in these contexts. */
if (sym->attr.vtype && sym->attr.use_assoc
&& sym->ns->proc_name == NULL)
return true;
/* F2008, C442. */