• Joe Tsai's avatar
    encoding/json: always ignore embedded pointers to unexported struct types · 0cee4b7b
    Joe Tsai authored
    CL 60410 fixes a bug in reflect that allows assignments to an embedded
    field of a pointer to an unexported struct type.
    This breaks the json package because unmarshal is now unable to assign
    a newly allocated struct to such fields.
    
    In order to be consistent in the behavior for marshal and unmarshal,
    this CL changes both marshal and unmarshal to always ignore
    embedded pointers to unexported structs.
    
    Fixes #21357
    
    Change-Id: If62ea11155555e61115ebb9cfa5305caf101bde5
    Reviewed-on: https://go-review.googlesource.com/76851
    Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    0cee4b7b
Name
Last commit
Last update
..
ascii85 Loading commit data...
asn1 Loading commit data...
base32 Loading commit data...
base64 Loading commit data...
binary Loading commit data...
csv Loading commit data...
gob Loading commit data...
hex Loading commit data...
json Loading commit data...
pem Loading commit data...
xml Loading commit data...
encoding.go Loading commit data...