aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2019-01-08 20:29:01 +0100
committerJanus Weil <janus@gcc.gnu.org>2019-01-08 20:29:01 +0100
commit903ecc6c2a564e4d3754082e2025e1d80fddf5a4 (patch)
tree6c542493d79d23d00525cdf2894dbeeee6e35f86 /gcc/fortran
parent6976bc87f162c542c2b92ee222401150af3fcc34 (diff)
downloadgcc-903ecc6c2a564e4d3754082e2025e1d80fddf5a4.zip
gcc-903ecc6c2a564e4d3754082e2025e1d80fddf5a4.tar.gz
gcc-903ecc6c2a564e4d3754082e2025e1d80fddf5a4.tar.bz2
re PR fortran/88047 (ICE in gfc_find_vtab, at fortran/class.c:2843)
2019-01-08 Janus Weil <janus@gcc.gnu.org> PR fortran/88047 * class.c (gfc_find_vtab): For polymorphic typespecs, the components of the class container may not be available (in case of invalid code). 2019-01-08 Janus Weil <janus@gcc.gnu.org> PR fortran/88047 * gfortran.dg/class_69.f90: New test case. From-SVN: r267735
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/class.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 73d47da..f29be83 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-08 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/88047
+ * class.c (gfc_find_vtab): For polymorphic typespecs, the components of
+ the class container may not be available (in case of invalid code).
+
2019-01-08 Richard Biener <rguenther@suse.de>
PR fortran/88611
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index 77f0fca..8809b5b 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -2846,7 +2846,10 @@ gfc_find_vtab (gfc_typespec *ts)
case BT_DERIVED:
return gfc_find_derived_vtab (ts->u.derived);
case BT_CLASS:
- return gfc_find_derived_vtab (ts->u.derived->components->ts.u.derived);
+ if (ts->u.derived->components && ts->u.derived->components->ts.u.derived)
+ return gfc_find_derived_vtab (ts->u.derived->components->ts.u.derived);
+ else
+ return NULL;
default:
return find_intrinsic_vtab (ts);
}