Преглед изворни кода

fix decoding of nil non-empty interface

Jason Toffaletti пре 8 година
родитељ
комит
c59c42fda0
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      feature_reflect_native.go

+ 3 - 0
feature_reflect_native.go

@@ -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
 }