diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-02-27 01:41:25 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-02-27 01:41:25 +0000 |
commit | 6054700c46cfee76846678750972993d8447374c (patch) | |
tree | 239ec1b1747aa736f4812d8a72adf2cc668c6ef9 /gcc | |
parent | 15994bfbcaf3c71f9e33b080d62ec46690674552 (diff) | |
download | gcc-6054700c46cfee76846678750972993d8447374c.zip gcc-6054700c46cfee76846678750972993d8447374c.tar.gz gcc-6054700c46cfee76846678750972993d8447374c.tar.bz2 |
compiler: check recursive inherited interface aliases
Fixes golang/go#25302.
Reviewed-on: https://go-review.googlesource.com/c/163298
From-SVN: r269241
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/types.cc | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index d601bb9..bb8a931 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -9c1859b8e97242b0e697a3aaa39a4da5e6172e74 +2c74b84184941ebea318f69fe43a81f657790b63 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 9081af6..82f9fb0 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -10329,6 +10329,23 @@ Find_alias::type(Type* type) return TRAVERSE_SKIP_COMPONENTS; } + // Check if there are recursive inherited interface aliases. + Interface_type* ift = type->interface_type(); + if (ift != NULL) + { + const Typed_identifier_list* methods = ift->local_methods(); + if (methods == NULL) + return TRAVERSE_CONTINUE; + for (Typed_identifier_list::const_iterator p = methods->begin(); + p != methods->end(); + ++p) + if (p->name().empty() && p->type()->named_type() == this->find_type_) + { + this->found_ = true; + return TRAVERSE_EXIT; + } + } + return TRAVERSE_CONTINUE; } |