Skip to content

Commit b9ee0ce

Browse files
author
ian
committed
compiler: check recursive inherited interface aliases
Fixes golang/go#25302. Reviewed-on: https://go-review.googlesource.com/c/163298 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269241 138bc75d-0d04-0410-961f-82ee72b054a4
1 parent fa3e2ed commit b9ee0ce

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

gcc/go/gofrontend/MERGE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
9c1859b8e97242b0e697a3aaa39a4da5e6172e74
1+
2c74b84184941ebea318f69fe43a81f657790b63
22

33
The first line of this file holds the git revision number of the last
44
merge done from the gofrontend repository.

gcc/go/gofrontend/types.cc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10329,6 +10329,23 @@ Find_alias::type(Type* type)
1032910329
return TRAVERSE_SKIP_COMPONENTS;
1033010330
}
1033110331

10332+
// Check if there are recursive inherited interface aliases.
10333+
Interface_type* ift = type->interface_type();
10334+
if (ift != NULL)
10335+
{
10336+
const Typed_identifier_list* methods = ift->local_methods();
10337+
if (methods == NULL)
10338+
return TRAVERSE_CONTINUE;
10339+
for (Typed_identifier_list::const_iterator p = methods->begin();
10340+
p != methods->end();
10341+
++p)
10342+
if (p->name().empty() && p->type()->named_type() == this->find_type_)
10343+
{
10344+
this->found_ = true;
10345+
return TRAVERSE_EXIT;
10346+
}
10347+
}
10348+
1033210349
return TRAVERSE_CONTINUE;
1033310350
}
1033410351

0 commit comments

Comments
 (0)