diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2017-11-28 15:13:42 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2017-11-28 15:13:42 +0000 |
commit | a964d4b12be9d8ed027b5faa3f3c439eff08ef16 (patch) | |
tree | 76ffa20a6271857fe987307da7b440cc60b024c5 /gcc/fortran/resolve.c | |
parent | 4aa458f2ac11aef044a08fcb32dc2c2401cf6561 (diff) | |
download | gcc-a964d4b12be9d8ed027b5faa3f3c439eff08ef16.zip gcc-a964d4b12be9d8ed027b5faa3f3c439eff08ef16.tar.gz gcc-a964d4b12be9d8ed027b5faa3f3c439eff08ef16.tar.bz2 |
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
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 9a81401..fe2f43a 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -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. */ |