public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Go patch committed: Don't set btype_ field too early for an alias type
@ 2018-07-17 18:27 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2018-07-17 18:27 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 409 bytes --]

This patch by Cherry Zhang fixes a problem in the Go frontend
introduced by https://golang.org/cl/123362.  A type's btype_ field
should not be set before named types are converted if it is a
placeholder.  For alias type, it iwas set too early.  That could
result in unresolved placeholders.  This patch fixes the problem.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1044 bytes --]

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 262830)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@
-d6338c94e5574b63469c740159d064e89c6718bf
+38850073f25f9de4f3daa33d799def3a33c942ab
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: gcc/go/gofrontend/types.cc
===================================================================
--- gcc/go/gofrontend/types.cc	(revision 262830)
+++ gcc/go/gofrontend/types.cc	(working copy)
@@ -992,8 +992,10 @@ Type::get_backend(Gogo* gogo)
     return this->btype_;
 
   if (this->named_type() != NULL && this->named_type()->is_alias()) {
-    this->btype_ = this->unalias()->get_backend(gogo);
-    return this->btype_;
+    Btype* bt = this->unalias()->get_backend(gogo);
+    if (gogo != NULL && gogo->named_types_are_converted())
+      this->btype_ = bt;
+    return bt;
   }
 
   if (this->forward_declaration_type() != NULL

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-07-17 18:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-17 18:27 Go patch committed: Don't set btype_ field too early for an alias type Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).