This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgo patch committed: Canonicalize types returned by StructOf, et. al.


This libgo patch by Massimiliano Ghilardi changes the reflect package
to canonicalize types returned by StructOf() and friends.

Since gccgo does not currently merge identical types at link time, the
reflect function canonicalize() exists to choose a canonical specimen
for each set of identical types. In this way, user code has the
guarantee that identical types will always compare as ==.

This patch changes the functions MapOf, SliceOf, StructOf, etc., to
call canonicalize on the types they create, before storing the types
in internal lookup caches and returning them.

This fixes known cases where canonicalize is needed but was missing.
Supersedes https://golang.org/cl/112575 and mostly fixes
https://golang.org/issue/25284.

Ian

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]