commit f9aef7e7d320df8560e602d863e97ea324e68644
Author: burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri Oct 18 12:04:31 2019 +0000
Fortran] PR91586 Fix ICE on invalid code with CLASS
gcc/fortran/
PR fortran/91586
* class.c (gfc_find_derived_vtab): Return NULL
instead of deref'ing NULL pointer.
gcc/testsuite/
PR fortran/91586
* gfortran.dg/class_71.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@277153 138bc75d-0d04-0410-961f-82ee72b054a4
@@ -1,3 +1,9 @@
+2019-10-18 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/91586
+ * class.c (gfc_find_derived_vtab): Return NULL
+ instead of deref'ing NULL pointer.
+
2019-10-15 James Norris <jnorris@codesourcery.com>
Tobias Burnus <tobias@codesourcery.com>
@@ -2241,6 +2241,9 @@ gfc_find_derived_vtab (gfc_symbol *derived)
if (!derived->attr.unlimited_polymorphic && derived->attr.is_class)
derived = gfc_get_derived_super_type (derived);
+ if (!derived)
+ return NULL;
+
/* Find the gsymbol for the module of use associated derived types. */
if ((derived->attr.use_assoc || derived->attr.used_in_submodule)
&& !derived->attr.vtype && !derived->attr.is_class)
@@ -1,3 +1,8 @@
+2019-10-18 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/91586
+ * gfortran.dg/class_71.f90: New.
+
2019-10-18 Georg-Johann Lay <avr@gjlay.de>
Fix some fallout for small targets.
new file mode 100644
@@ -0,0 +1,13 @@
+! { dg-do compile }
+!
+! PR fortran/91586
+!
+! Contributed by G. Steinmetz
+!
+program p
+ type t
+ class(*), allocatable :: a
+ end type
+ class(t) :: x, y ! { dg-error "must be dummy, allocatable or pointer" }
+ y = x ! { dg-error "Nonallocatable variable must not be polymorphic in intrinsic assignment" }
+end