aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/class.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2019-01-05 15:32:12 +0100
committerJanus Weil <janus@gcc.gnu.org>2019-01-05 15:32:12 +0100
commitf8add009ce300f24b75e9c2e2cc5dd944a020c28 (patch)
tree5a6cb69b2476a6dcebaa5cce4fc91ee5158c3fd4 /gcc/fortran/class.c
parent23141e52419417d34eab8a2976fe417a6041e15e (diff)
downloadgcc-f8add009ce300f24b75e9c2e2cc5dd944a020c28.zip
gcc-f8add009ce300f24b75e9c2e2cc5dd944a020c28.tar.gz
gcc-f8add009ce300f24b75e9c2e2cc5dd944a020c28.tar.bz2
re PR fortran/88009 (ICE in find_intrinsic_vtab, at fortran/class.c:2761)
2019-01-05 Janus Weil <janus@gcc.gnu.org> PR fortran/88009 * class.c (gfc_find_derived_vtab): Mark the _final component as artificial. (find_intrinsic_vtab): Ditto. Also add an extra check to avoid dereferencing a null pointer and adjust indentation. * resolve.c (resolve_fl_variable): Add extra check to avoid dereferencing a null pointer. Move variable declarations to local scope. (resolve_fl_procedure): Add extra check to avoid dereferencing a null pointer. * symbol.c (check_conflict): Suppress errors for artificial symbols. 2019-01-05 Janus Weil <janus@gcc.gnu.org> PR fortran/88009 * gfortran.dg/blockdata_10.f90: New test case. From-SVN: r267598
Diffstat (limited to 'gcc/fortran/class.c')
-rw-r--r--gcc/fortran/class.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index e55ab25..77f0fca 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -2466,6 +2466,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
goto cleanup;
c->attr.proc_pointer = 1;
c->attr.access = ACCESS_PRIVATE;
+ c->attr.artificial = 1;
c->tb = XCNEW (gfc_typebound_proc);
c->tb->ppc = 1;
generate_finalization_wrapper (derived, ns, tname, c);
@@ -2762,9 +2763,9 @@ find_intrinsic_vtab (gfc_typespec *ts)
/* This is elemental so that arrays are automatically
treated correctly by the scalarizer. */
copy->attr.elemental = 1;
- if (ns->proc_name->attr.flavor == FL_MODULE)
+ if (ns->proc_name && ns->proc_name->attr.flavor == FL_MODULE)
copy->module = ns->proc_name->name;
- gfc_set_sym_referenced (copy);
+ gfc_set_sym_referenced (copy);
/* Set up formal arguments. */
gfc_get_symbol ("src", sub_ns, &src);
src->ts.type = ts->type;
@@ -2798,6 +2799,7 @@ find_intrinsic_vtab (gfc_typespec *ts)
goto cleanup;
c->attr.proc_pointer = 1;
c->attr.access = ACCESS_PRIVATE;
+ c->attr.artificial = 1;
c->tb = XCNEW (gfc_typebound_proc);
c->tb->ppc = 1;
c->initializer = gfc_get_null_expr (NULL);