aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2020-06-30 23:36:56 +0200
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:15:38 -0300
commit63824f070df8580ccc1099f049b1b8800cd6345a (patch)
tree786a701017fde9416dd3d66137ae531da9329bf7 /gcc/fortran
parent041e963c8b9cd0c27ff5d76d70a19bd1c2974996 (diff)
downloadgcc-63824f070df8580ccc1099f049b1b8800cd6345a.zip
gcc-63824f070df8580ccc1099f049b1b8800cd6345a.tar.gz
gcc-63824f070df8580ccc1099f049b1b8800cd6345a.tar.bz2
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.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/resolve.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index f3e8ffc..4a2abd0 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -9045,7 +9045,7 @@ resolve_assoc_var (gfc_symbol* sym, bool resolve_target)
as = NULL;
sym->ts = *ts;
sym->ts.type = BT_CLASS;
- attr = CLASS_DATA (sym)->attr;
+ attr = CLASS_DATA (sym) ? CLASS_DATA (sym)->attr : sym->attr;
attr.class_ok = 0;
attr.associate_var = 1;
attr.dimension = attr.codimension = 0;