• 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

Revision66640d910595faded4425cfe2729ddf9d16e457b (tree)
Zeit2020-07-03 04:05:03
AutorHarald Anlauf <anlauf@gmx....>
CommiterHarald Anlauf

Log Message

PR fortran/88379 - ICE with allocatable coarray, class and associate

Catch NULL pointer dereference for ASSOCIATE on allocatable coarray variable.

gcc/fortran/
PR fortran/88379
* resolve.c (resolve_assoc_var): Avoid NULL pointer dereference.

(cherry picked from commit 267f84c6035c9380c8d1e9cb83ffe299c23e3a85)

Ändern Zusammenfassung

Diff

--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -9048,7 +9048,7 @@ resolve_assoc_var (gfc_symbol* sym, bool resolve_target)
90489048 as = NULL;
90499049 sym->ts = *ts;
90509050 sym->ts.type = BT_CLASS;
9051- attr = CLASS_DATA (sym)->attr;
9051+ attr = CLASS_DATA (sym) ? CLASS_DATA (sym)->attr : sym->attr;
90529052 attr.class_ok = 0;
90539053 attr.associate_var = 1;
90549054 attr.dimension = attr.codimension = 0;
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr88379.f90
@@ -0,0 +1,11 @@
1+! { dg-do compile }
2+! { dg-options "-fcoarray=single" }
3+! PR fortran/88379 - ICE with allocatable coarray, class and associate
4+
5+program p
6+ type t
7+ end type t
8+ class(t), allocatable :: x[:]
9+ associate (y => x)
10+ end associate
11+end