diff --git a/encode_vm.go b/encode_vm.go index b9f4eaf..a9ebb3b 100644 --- a/encode_vm.go +++ b/encode_vm.go @@ -550,7 +550,7 @@ func (e *Encoder) run(code *opcode) error { e.encodeBytes(field.key) } code = field.next - code.ptr = ptr + code.ptr = ptr + field.offset field.nextField.ptr = ptr } case opStructFieldAnonymousHead: