1
0
mirror of https://github.com/json-iterator/go.git synced 2025-04-23 11:37:32 +02:00

fix decoding of nil non-empty interface

This commit is contained in:
Jason Toffaletti 2017-09-16 16:24:55 -07:00
parent 8324374402
commit c59c42fda0

View File

@ -391,6 +391,9 @@ func (codec *nonEmptyInterfaceCodec) Decode(ptr unsafe.Pointer, iter *Iterator)
e.typ = nonEmptyInterface.itab.typ
e.word = nonEmptyInterface.word
iter.ReadVal(&i)
if e.word == nil {
nonEmptyInterface.itab = nil
}
nonEmptyInterface.word = e.word
}