Add iface value to keepRefs

This commit is contained in:
Masaaki Goshima 2021-01-24 13:49:56 +09:00
parent 669f910303
commit 345da09ed3
1 changed files with 1 additions and 0 deletions

View File

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