1
0
mirror of https://github.com/golang/go synced 2024-11-06 11:36:16 -07:00
go/src/encoding
Joe Tsai 5a03cbd12a encoding/json: use reflect.Value.UnsafePointer over Pointer
The latter returns a uintptr, while the former returns a unsafe.Pointer.
A uintptr is unsafe if Go ever switches to a moving GC,
while a unsafe.Pointer will be properly tracked by the GC.

We do not use unsafe.Pointer for any unsafe type conversions,
and only use it for comparability purposes, which is relatively safe.

Updates #40592

Change-Id: I813e218668704b63a3043acda4331205a3835a66
Reviewed-on: https://go-review.googlesource.com/c/go/+/360855
Trust: Joseph Tsai <joetsai@digital-static.net>
Trust: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-02 17:42:53 +00:00
..
ascii85 all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
asn1 all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
base32 all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
base64 all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
binary all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
csv
gob all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
hex
json encoding/json: use reflect.Value.UnsafePointer over Pointer 2022-03-02 17:42:53 +00:00
pem
xml encoding/xml: embedded reference to substruct causes XML marshaller to panic on encoding 2022-02-20 20:58:11 +00:00
encoding.go