[Bug go/66138] json decoder Decode function fails for some structure return values

ian at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Nov 7 01:26:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66138

--- Comment #4 from ian at gcc dot gnu.org <ian at gcc dot gnu.org> ---
Author: ian
Date: Sat Nov  7 01:25:43 2015
New Revision: 229908

URL: https://gcc.gnu.org/viewcvs?rev=229908&root=gcc&view=rev
Log:
        PR go/66138
    reflect, encoding/json, encoding/xml: fix unexported embedded structs

    Bring in three changes from the master Go repository.  These changes
    will be in Go 1.6, but they are appropriate for gccgo now because they
    resolve a long-standing discrepancy between how gc and gccgo handle the
    PkgPath field for embedded unexported struct fields.  The core issue is
    described at https://golang.org/cl/7247.  This has been reported against
    gccgo as https://gcc.gnu.org/PR66138.

    The three changes being brought over are:

    https://golang.org/cl/14010

    reflect: adjust access to unexported embedded structs

    This CL changes reflect to allow access to exported fields and
    methods in unexported embedded structs for gccgo and after gc
    has been adjusted to disallow access to embedded unexported structs.

    Adresses #12367, #7363, #11007, and #7247.

    https://golang.org/cl/14011

    encoding/json: check for exported fields in embedded structs

    Addresses issue #12367.

    https://golang.org/cl/14012

    encoding/xml: check for exported fields in embedded structs

    Addresses issue #12367.

    Reviewed-on: https://go-review.googlesource.com/16723

Modified:
    branches/gcc-5-branch/libgo/go/encoding/json/decode_test.go
    branches/gcc-5-branch/libgo/go/encoding/json/encode.go
    branches/gcc-5-branch/libgo/go/encoding/xml/marshal_test.go
    branches/gcc-5-branch/libgo/go/encoding/xml/typeinfo.go
    branches/gcc-5-branch/libgo/go/reflect/export_test.go
    branches/gcc-5-branch/libgo/go/reflect/type.go
    branches/gcc-5-branch/libgo/go/reflect/value.go


More information about the Gcc-bugs mailing list