From e17fc13a381e99ff23ca7c8dbcb692d73eeda680 Mon Sep 17 00:00:00 2001 From: janus Date: Sun, 29 May 2011 20:32:11 +0000 Subject: 2011-05-29 Janus Weil PR fortran/47601 * module.c (mio_component_ref): Handle components of extended types. * symbol.c (gfc_find_component): Return is sym is NULL. 2011-05-29 Janus Weil PR fortran/47601 * gfortran.dg/extends_13.f03: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174416 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/module.c | 10 +++------- gcc/fortran/symbol.c | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5ffa5f673f9..da086438ab5 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2011-05-29 Janus Weil + + PR fortran/47601 + * module.c (mio_component_ref): Handle components of extended types. + * symbol.c (gfc_find_component): Return is sym is NULL. + 2011-05-29 Tobias Burnus PR fortran/18918 diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index b6acca3a5f1..533246d0c8d 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -2356,14 +2356,10 @@ mio_component_ref (gfc_component **cp, gfc_symbol *sym) if (sym->components != NULL && p->u.pointer == NULL) { /* Symbol already loaded, so search by name. */ - for (q = sym->components; q; q = q->next) - if (strcmp (q->name, name) == 0) - break; - - if (q == NULL) - gfc_internal_error ("mio_component_ref(): Component not found"); + q = gfc_find_component (sym, name, true, true); - associate_integer_pointer (p, q); + if (q) + associate_integer_pointer (p, q); } /* Make sure this symbol will eventually be loaded. */ diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 4b4f75fe827..b761cdd47e8 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -1996,7 +1996,7 @@ gfc_find_component (gfc_symbol *sym, const char *name, { gfc_component *p; - if (name == NULL) + if (name == NULL || sym == NULL) return NULL; sym = gfc_use_derived (sym); -- cgit v1.2.1