• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

GCC with patches for OS216


Commit MetaInfo

Revisiond9fb6f2b4f1321b059807ff6073156f07d9d376b (tree)
Zeit2020-07-03 03:41:51
AutorHarald Anlauf <anlauf@gmx....>
CommiterHarald Anlauf

Log Message

PR fortran/93337 - ICE in gfc_dt_upper_string, at fortran/module.c:441

When declaring a polymorphic variable that is not a dummy, allocatable or
pointer, an ICE occurred due to a NULL pointer dereference. Check for
that situation and punt.

gcc/fortran/
PR fortran/93337
* class.c (gfc_find_derived_vtab): Punt if name is not set.

Ändern Zusammenfassung

Diff

--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -2277,6 +2277,9 @@ gfc_find_derived_vtab (gfc_symbol *derived)
22772277 if (!derived)
22782278 return NULL;
22792279
2280+ if (!derived->name)
2281+ return NULL;
2282+
22802283 /* Find the gsymbol for the module of use associated derived types. */
22812284 if ((derived->attr.use_assoc || derived->attr.used_in_submodule)
22822285 && !derived->attr.vtype && !derived->attr.is_class)
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr93337.f90
@@ -0,0 +1,10 @@
1+! { dg-do compile }
2+! PR fortran/93337 - ICE in gfc_dt_upper_string, at fortran/module.c:441
3+
4+program p
5+ type t
6+ character(:), allocatable :: a
7+ end type t
8+ class(t) :: x ! { dg-error "must be dummy, allocatable or pointer" }
9+ x = x ! { dg-error "must not be polymorphic in intrinsic assignment" }
10+end