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: r255205
This commit is contained in:
Paul Thomas 2017-11-28 15:38:55 +00:00
parent 326c95acd9
commit a82d7ade2d
2 changed files with 13 additions and 2 deletions

View File

@ -1,4 +1,11 @@
017-11-23 Paul Thomas <pault@gcc.gnu.org>
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-23 Paul Thomas <pault@gcc.gnu.org>
Backported from trunk

View File

@ -13301,7 +13301,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. */