re PR fortran/59493 ([OOP] ICE: Segfault on Class(*) pointer association)
authorJanus Weil <janus@gcc.gnu.org>
Sun, 15 Dec 2013 09:49:51 +0000 (10:49 +0100)
committerJanus Weil <janus@gcc.gnu.org>
Sun, 15 Dec 2013 09:49:51 +0000 (10:49 +0100)
2013-12-15  Janus Weil  <janus@gcc.gnu.org>

PR fortran/59493
* class.c (gfc_find_intrinsic_vtab): Handle BT_CLASS.

2013-12-15  Janus Weil  <janus@gcc.gnu.org>

PR fortran/59493
* gfortran.dg/unlimited_polymorphic_15.f90: New.

From-SVN: r205997

gcc/fortran/ChangeLog
gcc/fortran/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/unlimited_polymorphic_15.f90 [new file with mode: 0644]

index 9de18607db3ee27cdaf5e913dd5ed0da9e3e2fbf..a7d2ff8a8a40df84af1176579f9674df1cf1de01 100644 (file)
@@ -1,3 +1,8 @@
+2013-12-15  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/59493
+       * class.c (gfc_find_intrinsic_vtab): Handle BT_CLASS.
+
 2013-12-14  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/59502
index 52b9760b271738638d0427bd0244045415db261f..b65cd892b1d4d2ec74ffcc6ee669e1d9b253ff6f 100644 (file)
@@ -2424,7 +2424,7 @@ gfc_find_intrinsic_vtab (gfc_typespec *ts)
     return NULL;
 
   /* Sometimes the typespec is passed from a single call.  */
-  if (ts->type == BT_DERIVED)
+  if (ts->type == BT_DERIVED || ts->type == BT_CLASS)
     return gfc_find_derived_vtab (ts->u.derived);
 
   /* Find the top-level namespace.  */
index ccb78290915c805e79dcd9216b55f2493c88f0b7..7074acab2aef257787287b08efec670b6d071637 100644 (file)
@@ -1,3 +1,8 @@
+2013-12-15  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/59493
+       * gfortran.dg/unlimited_polymorphic_15.f90: New.
+
 2013-12-14   Jan Hubicka  <jh@suse.cz>
 
        PR middle-end/58477
diff --git a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_15.f90 b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_15.f90
new file mode 100644 (file)
index 0000000..1dfebdc
--- /dev/null
@@ -0,0 +1,17 @@
+! { dg-do compile }
+!
+! PR 59493: [OOP] ICE: Segfault on Class(*) pointer association
+!
+! Contributed by Hossein Talebi <talebi.hossein@gmail.com>
+
+  implicit none
+
+  type ty_mytype1
+  end type
+
+  class(ty_mytype1), allocatable, target:: cla1
+  class(*), pointer :: ptr
+
+  ptr => cla1
+
+end