This commit is contained in:
Masaaki Goshima 2021-01-24 14:57:57 +09:00
parent 6466e00432
commit 66e706beb7
1 changed files with 6 additions and 0 deletions

View File

@ -170,6 +170,12 @@ func (e *Encoder) runEscaped(ctx *encodeRuntimeContext, b []byte, codeSet *opcod
} }
} }
iface := (*interfaceHeader)(e.ptrToUnsafePtr(ptr)) iface := (*interfaceHeader)(e.ptrToUnsafePtr(ptr))
if iface == nil {
b = encodeNull(b)
b = encodeComma(b)
code = code.next
break
}
ctx.keepRefs = append(ctx.keepRefs, unsafe.Pointer(iface)) ctx.keepRefs = append(ctx.keepRefs, unsafe.Pointer(iface))
if iface.ptr == nil { if iface.ptr == nil {
b = encodeNull(b) b = encodeNull(b)