diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-07-17 18:27:22 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-07-17 18:27:22 +0000 |
commit | a7385f1c0eb0986f7d6bc68ea3f26e5a96f50c80 (patch) | |
tree | 213242c614addd37def16a072bbf681bb8ec643c /gcc/go | |
parent | 0c86a39db2888ddd17b21d0822b0907e4661d8b6 (diff) | |
download | gcc-a7385f1c0eb0986f7d6bc68ea3f26e5a96f50c80.zip gcc-a7385f1c0eb0986f7d6bc68ea3f26e5a96f50c80.tar.gz gcc-a7385f1c0eb0986f7d6bc68ea3f26e5a96f50c80.tar.bz2 |
compiler: don't set btype_ too early for alias type
CL 123362 introduced a bug in creating alias type's backend
representation. A type's btype_ should not be set before
named types are converted if it is a placeholder. For alias
type, it is set too early. This may result in unresolved
placeholders. This CL fixes it.
Reviewed-on: https://go-review.googlesource.com/123975
From-SVN: r262833
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/types.cc | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index f9d37e7..726bf3a 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -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. diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index fa8c0ad..2fb6706 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -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 |