dadcc51c88
When an interface I1 in an imported package has an unexported method, and is then embedded into another interface I2, in a different package, that has other methods, and a type T2 is converted to I2, we failed to ever define the required interface method table. Naturally T2 must implement the unexported method, and must therefore either be defined in the same package as I1, or embed a type from that package. In this case the compiler was assuming that that package would define the interface method table, but of course, since I2 was not defined in that package, that did not happen. The fix is to only assume that the interface method table will be defined elsewhere in the case where T2 and I2 are defined in the same package. The compiler ensures that all such interface method tables are created, in Gogo::build_interface_method_tables. This requires knowing the package in which an interface type is defined, a simple tweak to the importer. Testing this revealed that the special case for stub methods created for the embedded unexported methods of T2 needs to be done for function declarations as it currently is for function definitions, so that the newly created interface method tables use the correct name. Testing that revealed that the code to determine the pkgpath symbol for such stub methods was wrong. It assumed that one could call pkgpath_for_symbol on the pkgpath to get the pkgpath symbol. Would that it twere so simple. Instead, add a function to look up the package, which must be known, and fetch the pkgpath symbol. The test for this is https://golang.org/cl/45085. Reviewed-on: https://go-review.googlesource.com/45086 From-SVN: r249024 |
||
---|---|---|
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcilkrts | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libhsail-rt | ||
libiberty | ||
libitm | ||
libmpx | ||
libobjc | ||
liboffloadmic | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
README | ||
symlink-tree | ||
ylwrap |
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.