aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2015-11-20 13:23:02 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-11-20 13:23:02 +0000
commit0b78e62cff89045311459e512a43fc9010c61353 (patch)
treea7499d014420eda58a869d2abe41ad44c62a5474 /gcc/go
parent430002b956a29c8dc6f3be66156ebcbd8f44dcb6 (diff)
downloadgcc-0b78e62cff89045311459e512a43fc9010c61353.zip
gcc-0b78e62cff89045311459e512a43fc9010c61353.tar.gz
gcc-0b78e62cff89045311459e512a43fc9010c61353.tar.bz2
compiler: Use receiver name in hash/equal for type within method.
Test case sent as https://golang.org/cl/17081. Reviewed-on: https://go-review.googlesource.com/17082 From-SVN: r230657
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/types.cc11
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index d23a6cb..d43f431 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-e3aef41ce0c5be81e2589e60d9cb0db1516e9e2d
+dfa74d975884f363c74d6a66a37b1703093fdba6
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 822037d..64b560b 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -1769,7 +1769,16 @@ Type::specific_type_functions(Gogo* gogo, Named_type* name,
const Named_object* in_function = name->in_function(&index);
if (in_function != NULL)
{
- base_name += '$' + Gogo::unpack_hidden_name(in_function->name());
+ base_name.append(1, '$');
+ const Typed_identifier* rcvr =
+ in_function->func_value()->type()->receiver();
+ if (rcvr != NULL)
+ {
+ Named_type* rcvr_type = rcvr->type()->deref()->named_type();
+ base_name.append(Gogo::unpack_hidden_name(rcvr_type->name()));
+ base_name.append(1, '$');
+ }
+ base_name.append(Gogo::unpack_hidden_name(in_function->name()));
if (index > 0)
{
char buf[30];