]> gcc.gnu.org Git - gcc.git/commitdiff
compiler: Use receiver name in hash/equal for type within method.
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 20 Nov 2015 13:23:02 +0000 (13:23 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 20 Nov 2015 13:23:02 +0000 (13:23 +0000)
    Test case sent as https://golang.org/cl/17081.

    Reviewed-on: https://go-review.googlesource.com/17082

From-SVN: r230657

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/types.cc

index d23a6cb5f58bf32f44394230c8f344e89dbe0b68..d43f4311ed21571122faed03837b5e68d5ee5d01 100644 (file)
@@ -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.
index 822037d1bbf2a741dae58f5614187d8a99df815d..64b560b45d6f259b8b1ec5d2d85567a0dd749808 100644 (file)
@@ -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];
This page took 0.07535 seconds and 5 git commands to generate.