diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-12-11 00:15:53 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-12-11 00:15:53 +0000 |
commit | 1e2b400bbbd1adc3e0ada881a17cd6813cec7a3d (patch) | |
tree | 0f21ae89b5d4f227428b38a9c13bd40cb5b934ee /gcc | |
parent | cff87282f4f50c2fd471a2fe0df49312716a8caf (diff) | |
download | gcc-1e2b400bbbd1adc3e0ada881a17cd6813cec7a3d.zip gcc-1e2b400bbbd1adc3e0ada881a17cd6813cec7a3d.tar.gz gcc-1e2b400bbbd1adc3e0ada881a17cd6813cec7a3d.tar.bz2 |
compiler: generate type descriptor for pointer to alias defined in another package
When a type descriptor is needed (for e.g. interface conversion),
if the type is a pointer to a named type defined in another
package, we don't generate the definition of the type descriptor
because it is generated in the package where the type is defined.
However, if the named type is an alias to an unnamed type, its
descriptor is not generated in the other package, and we need to
generate it.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/210787
From-SVN: r279207
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/types.cc | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 93e29b7..b293373 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -6f2bf15e15bf7516c393966577d72b79cba7f980 +85641a0f26061f7c98db42a2adb3250c07ce504e 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 e02b832..7afdba7 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -1453,13 +1453,13 @@ Type::type_descriptor_defined_elsewhere(Named_type* nt, else { if (this->points_to() != NULL - && this->points_to()->named_type() != NULL - && this->points_to()->named_type()->named_object()->package() != NULL) + && this->points_to()->unalias()->named_type() != NULL + && this->points_to()->unalias()->named_type()->named_object()->package() != NULL) { // This is an unnamed pointer to a named type defined in a // different package. The descriptor should be defined in // that package. - *package = this->points_to()->named_type()->named_object()->package(); + *package = this->points_to()->unalias()->named_type()->named_object()->package(); return true; } } |