From 24cc1b77b22b7c937101f88d08eabdc893c9c5b3 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Thu, 18 Feb 2021 19:20:07 +0900 Subject: [PATCH] Fix checkptr error --- encode_vm_escaped.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encode_vm_escaped.go b/encode_vm_escaped.go index 1188b57..b0efc65 100644 --- a/encode_vm_escaped.go +++ b/encode_vm_escaped.go @@ -242,7 +242,7 @@ func encodeRunEscaped(ctx *encodeRuntimeContext, b []byte, codeSet *opcodeSet, o ptr := load(ctxptr, code.idx) isPtr := code.typ.Kind() == reflect.Ptr p := ptrToUnsafePtr(ptr) - if p == nil || isPtr && *(*unsafe.Pointer)(p) == nil { + if p == nil || isPtr && **(**unsafe.Pointer)(unsafe.Pointer(&p)) == nil { b = append(b, '"', '"', ',') } else { v := *(*interface{})(unsafe.Pointer(&interfaceHeader{