Browse Source

fix decoding of nil non-empty interface

Jason Toffaletti 8 năm trước cách đây
mục cha
commit
c59c42fda0
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  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
 }