Descriptionencoding/json: don't cache value addressability when building first encoder
newTypeEncoder (called once per type and then cached) was
looking at the first value seen of that type's addressability
and caching the encoder decision. If the first value seen was
addressable and a future one wasn't, it would panic.
Instead, introduce a new wrapper encoder type that checks
CanAddr at runtime.
Fixes Issue 6458
Patch Set 1 #Patch Set 2 : diff -r fa9c4c1f250d https://go.googlecode.com/hg/ #Patch Set 3 : diff -r fa9c4c1f250d https://go.googlecode.com/hg/ #
Total comments: 5
Patch Set 4 : diff -r fa9c4c1f250d https://go.googlecode.com/hg/ #Patch Set 5 : diff -r fa9c4c1f250d https://go.googlecode.com/hg/ #Patch Set 6 : diff -r fa9c4c1f250d https://go.googlecode.com/hg/ #
Total comments: 2
Patch Set 7 : diff -r d0364d7d990d https://go.googlecode.com/hg/ #MessagesTotal messages: 10
|