From: Ian Lance Taylor Date: Wed, 19 Jan 2011 15:47:50 +0000 (+0000) Subject: Fix handling of anonymous field in struct with pointer type. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ca82dd6bae0055cf2c8b95823dea52a1d2e92f0;p=gcc.git Fix handling of anonymous field in struct with pointer type. From-SVN: r169001 --- diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index bbf217abacc..1a68e772440 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -7948,7 +7948,9 @@ Type::find_field_or_method(const Type* type, || pf->type()->deref()->is_undefined()) continue; - Named_type* fnt = pf->type()->deref()->named_type(); + Named_type* fnt = pf->type()->named_type(); + if (fnt == NULL) + fnt = pf->type()->deref()->named_type(); gcc_assert(fnt != NULL); int sublevel = level == NULL ? 1 : *level + 1;