]> Cypherpunks repositories - gostls13.git/commit
encoding/json: detect cyclic maps and slices
authorlujjjh <lujjjh@gmail.com>
Thu, 17 Sep 2020 14:39:13 +0000 (14:39 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 24 Sep 2020 18:18:20 +0000 (18:18 +0000)
commit428509402b03c608e625a4844ab0cce75e4bead2
treeb24e7a03d00c5c7f30e935801c1f3c426f8abcd9
parent25a33daa2b7e7bda773705215113450923ae4815
encoding/json: detect cyclic maps and slices

Now reports an error if cyclic maps and slices are to be encoded
instead of an infinite recursion. This case wasn't handled in CL 187920.

Fixes #40745.

Change-Id: Ia34b014ecbb71fd2663bb065ba5355a307dbcc15
GitHub-Last-Rev: 6f874944f4065b5237babbb0fdce14c1c74a3c97
GitHub-Pull-Request: golang/go#40756
Reviewed-on: https://go-review.googlesource.com/c/go/+/248358
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Trust: Daniel Martí <mvdan@mvdan.cc>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Go Bot <gobot@golang.org>
src/encoding/json/encode.go
src/encoding/json/encode_test.go