mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
gob: when decoding a string, allocate a string, not a []byte.
R=r, r2 CC=golang-dev https://golang.org/cl/4430042
This commit is contained in:
parent
bdcc0437f6
commit
a696da10e0
1 changed files with 1 additions and 1 deletions
|
|
@ -406,7 +406,7 @@ func decUint8Array(i *decInstr, state *decoderState, p unsafe.Pointer) {
|
|||
func decString(i *decInstr, state *decoderState, p unsafe.Pointer) {
|
||||
if i.indir > 0 {
|
||||
if *(*unsafe.Pointer)(p) == nil {
|
||||
*(*unsafe.Pointer)(p) = unsafe.Pointer(new([]byte))
|
||||
*(*unsafe.Pointer)(p) = unsafe.Pointer(new(string))
|
||||
}
|
||||
p = *(*unsafe.Pointer)(p)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue