From e9e9aa887494f5453f63576408e0533e6d8e0c3e Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Tue, 15 Sep 2020 20:48:16 +0900 Subject: [PATCH] Use next code index for recursive call --- encode_vm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encode_vm.go b/encode_vm.go index bd732cc..2bb7349 100644 --- a/encode_vm.go +++ b/encode_vm.go @@ -654,7 +654,7 @@ func (e *Encoder) run(ctx *encodeRuntimeContext, code *opcode) error { } ctxptr = ctx.ptr() + ptrOffset // assign new ctxptr - store(ctxptr, 0, ptr) + store(ctxptr, c.idx, ptr) store(ctxptr, lastCode.idx, oldOffset) store(ctxptr, lastCode.elemIdx, uintptr(unsafe.Pointer(code.next)))