Fix checkptr error

This commit is contained in:
Masaaki Goshima 2021-02-18 19:20:07 +09:00
parent 23c5766bd2
commit 24cc1b77b2
1 changed files with 1 additions and 1 deletions

View File

@ -242,7 +242,7 @@ func encodeRunEscaped(ctx *encodeRuntimeContext, b []byte, codeSet *opcodeSet, o
ptr := load(ctxptr, code.idx) ptr := load(ctxptr, code.idx)
isPtr := code.typ.Kind() == reflect.Ptr isPtr := code.typ.Kind() == reflect.Ptr
p := ptrToUnsafePtr(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, '"', '"', ',') b = append(b, '"', '"', ',')
} else { } else {
v := *(*interface{})(unsafe.Pointer(&interfaceHeader{ v := *(*interface{})(unsafe.Pointer(&interfaceHeader{