compiler: Create pointer type for all types with methods.
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 30 Oct 2015 23:00:06 +0000 (23:00 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 30 Oct 2015 23:00:06 +0000 (23:00 +0000)
    Reviewed-on: https://go-review.googlesource.com/16522

From-SVN: r229612

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

index 987bd684c59f1f6e0b5366734f2298d02b163d7f..5d35b04a15cdd642b3ad8b8ce271b392c5d5d95e 100644 (file)
@@ -1,4 +1,4 @@
-85994dd0a88d1b24b2ddfc9c9ab22ee16c9e8b54
+16f69a4007a1903da4055a496882b514e05f45f3
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index b4620ff0c86af54555da0e29de259ea2376b7424..822037d1bbf2a741dae58f5614187d8a99df815d 100644 (file)
@@ -2064,11 +2064,15 @@ Type::type_descriptor_constructor(Gogo* gogo, int runtime_type_kind,
 
   ++p;
   go_assert(p->is_field_name("ptrToThis"));
-  if (name == NULL)
+  if (name == NULL && methods == NULL)
     vals->push_back(Expression::make_nil(bloc));
   else
     {
-      Type* pt = Type::make_pointer_type(name);
+      Type* pt;
+      if (name != NULL)
+       pt = Type::make_pointer_type(name);
+      else
+       pt = Type::make_pointer_type(this);
       vals->push_back(Expression::make_type_descriptor(pt, bloc));
     }