aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/class.c')
-rw-r--r--gcc/fortran/class.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index a627448..6d324a6 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -238,12 +238,14 @@ gfc_add_component_ref (gfc_expr *e, const char *name)
/* Avoid losing memory. */
gfc_free_ref_list (*tail);
c = gfc_find_component (derived, name, true, true, tail);
- gcc_assert (c);
- for (ref = *tail; ref->next; ref = ref->next)
- ;
- ref->next = next;
- if (!next)
- e->ts = c->ts;
+
+ if (c) {
+ for (ref = *tail; ref->next; ref = ref->next)
+ ;
+ ref->next = next;
+ if (!next)
+ e->ts = c->ts;
+ }
}