diff options
author | Janus Weil <janus@gcc.gnu.org> | 2016-11-09 10:22:52 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2016-11-09 10:22:52 +0100 |
commit | 5f395580078d31f52b920a46a723da54c080a04e (patch) | |
tree | 330b6280c13ed8c8598700f1b8fc0611247f2631 /gcc/fortran/class.c | |
parent | 37b141851078b5119156780c2d897639d483625b (diff) | |
download | gcc-5f395580078d31f52b920a46a723da54c080a04e.zip gcc-5f395580078d31f52b920a46a723da54c080a04e.tar.gz gcc-5f395580078d31f52b920a46a723da54c080a04e.tar.bz2 |
re PR fortran/71894 ([OOP] ICE in gfc_add_component_ref, at fortran/class.c:227)
2016-11-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/71894
* class.c (gfc_add_component_ref): Add safety checks to avoid ICE.
2016-11-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/71894
* gfortran.dg/class_59.f90: New test.
From-SVN: r241993
Diffstat (limited to 'gcc/fortran/class.c')
-rw-r--r-- | gcc/fortran/class.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index 400c22a..b7f68d2 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -224,7 +224,8 @@ gfc_add_component_ref (gfc_expr *e, const char *name) break; tail = &((*tail)->next); } - if (derived->components->next->ts.type == BT_DERIVED && + if (derived->components && derived->components->next && + derived->components->next->ts.type == BT_DERIVED && derived->components->next->ts.u.derived == NULL) { /* Fix up missing vtype. */ |