Преглед на файлове

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
 }