mirror of https://github.com/goccy/go-json.git
Fix test
This commit is contained in:
parent
92d8dcd13b
commit
97c3cf6c55
|
@ -190,12 +190,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
typ *runtime.Type
|
typ *runtime.Type
|
||||||
ifacePtr unsafe.Pointer
|
ifacePtr unsafe.Pointer
|
||||||
)
|
)
|
||||||
|
up := ptrToUnsafePtr(p)
|
||||||
if code.Flags&encoder.NonEmptyInterfaceFlags != 0 {
|
if code.Flags&encoder.NonEmptyInterfaceFlags != 0 {
|
||||||
iface := (*nonEmptyInterface)(ptrToUnsafePtr(p))
|
iface := (*nonEmptyInterface)(up)
|
||||||
ifacePtr = iface.ptr
|
ifacePtr = iface.ptr
|
||||||
typ = iface.itab.typ
|
typ = iface.itab.typ
|
||||||
} else {
|
} else {
|
||||||
iface := (*emptyInterface)(ptrToUnsafePtr(p))
|
iface := (*emptyInterface)(up)
|
||||||
ifacePtr = iface.ptr
|
ifacePtr = iface.ptr
|
||||||
typ = iface.typ
|
typ = iface.typ
|
||||||
}
|
}
|
||||||
|
@ -205,7 +206,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
code = code.Next
|
code = code.Next
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
ctx.KeepRefs = append(ctx.KeepRefs, unsafe.Pointer(p))
|
ctx.KeepRefs = append(ctx.KeepRefs, up)
|
||||||
ifaceCodeSet, err := encoder.CompileToGetCodeSet(uintptr(unsafe.Pointer(typ)))
|
ifaceCodeSet, err := encoder.CompileToGetCodeSet(uintptr(unsafe.Pointer(typ)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -190,12 +190,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
typ *runtime.Type
|
typ *runtime.Type
|
||||||
ifacePtr unsafe.Pointer
|
ifacePtr unsafe.Pointer
|
||||||
)
|
)
|
||||||
|
up := ptrToUnsafePtr(p)
|
||||||
if code.Flags&encoder.NonEmptyInterfaceFlags != 0 {
|
if code.Flags&encoder.NonEmptyInterfaceFlags != 0 {
|
||||||
iface := (*nonEmptyInterface)(ptrToUnsafePtr(p))
|
iface := (*nonEmptyInterface)(up)
|
||||||
ifacePtr = iface.ptr
|
ifacePtr = iface.ptr
|
||||||
typ = iface.itab.typ
|
typ = iface.itab.typ
|
||||||
} else {
|
} else {
|
||||||
iface := (*emptyInterface)(ptrToUnsafePtr(p))
|
iface := (*emptyInterface)(up)
|
||||||
ifacePtr = iface.ptr
|
ifacePtr = iface.ptr
|
||||||
typ = iface.typ
|
typ = iface.typ
|
||||||
}
|
}
|
||||||
|
@ -205,7 +206,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
code = code.Next
|
code = code.Next
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
ctx.KeepRefs = append(ctx.KeepRefs, unsafe.Pointer(p))
|
ctx.KeepRefs = append(ctx.KeepRefs, up)
|
||||||
ifaceCodeSet, err := encoder.CompileToGetCodeSet(uintptr(unsafe.Pointer(typ)))
|
ifaceCodeSet, err := encoder.CompileToGetCodeSet(uintptr(unsafe.Pointer(typ)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -190,12 +190,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
typ *runtime.Type
|
typ *runtime.Type
|
||||||
ifacePtr unsafe.Pointer
|
ifacePtr unsafe.Pointer
|
||||||
)
|
)
|
||||||
|
up := ptrToUnsafePtr(p)
|
||||||
if code.Flags&encoder.NonEmptyInterfaceFlags != 0 {
|
if code.Flags&encoder.NonEmptyInterfaceFlags != 0 {
|
||||||
iface := (*nonEmptyInterface)(ptrToUnsafePtr(p))
|
iface := (*nonEmptyInterface)(up)
|
||||||
ifacePtr = iface.ptr
|
ifacePtr = iface.ptr
|
||||||
typ = iface.itab.typ
|
typ = iface.itab.typ
|
||||||
} else {
|
} else {
|
||||||
iface := (*emptyInterface)(ptrToUnsafePtr(p))
|
iface := (*emptyInterface)(up)
|
||||||
ifacePtr = iface.ptr
|
ifacePtr = iface.ptr
|
||||||
typ = iface.typ
|
typ = iface.typ
|
||||||
}
|
}
|
||||||
|
@ -205,7 +206,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
code = code.Next
|
code = code.Next
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
ctx.KeepRefs = append(ctx.KeepRefs, unsafe.Pointer(p))
|
ctx.KeepRefs = append(ctx.KeepRefs, up)
|
||||||
ifaceCodeSet, err := encoder.CompileToGetCodeSet(uintptr(unsafe.Pointer(typ)))
|
ifaceCodeSet, err := encoder.CompileToGetCodeSet(uintptr(unsafe.Pointer(typ)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -190,12 +190,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
typ *runtime.Type
|
typ *runtime.Type
|
||||||
ifacePtr unsafe.Pointer
|
ifacePtr unsafe.Pointer
|
||||||
)
|
)
|
||||||
|
up := ptrToUnsafePtr(p)
|
||||||
if code.Flags&encoder.NonEmptyInterfaceFlags != 0 {
|
if code.Flags&encoder.NonEmptyInterfaceFlags != 0 {
|
||||||
iface := (*nonEmptyInterface)(ptrToUnsafePtr(p))
|
iface := (*nonEmptyInterface)(up)
|
||||||
ifacePtr = iface.ptr
|
ifacePtr = iface.ptr
|
||||||
typ = iface.itab.typ
|
typ = iface.itab.typ
|
||||||
} else {
|
} else {
|
||||||
iface := (*emptyInterface)(ptrToUnsafePtr(p))
|
iface := (*emptyInterface)(up)
|
||||||
ifacePtr = iface.ptr
|
ifacePtr = iface.ptr
|
||||||
typ = iface.typ
|
typ = iface.typ
|
||||||
}
|
}
|
||||||
|
@ -205,7 +206,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
code = code.Next
|
code = code.Next
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
ctx.KeepRefs = append(ctx.KeepRefs, unsafe.Pointer(p))
|
ctx.KeepRefs = append(ctx.KeepRefs, up)
|
||||||
ifaceCodeSet, err := encoder.CompileToGetCodeSet(uintptr(unsafe.Pointer(typ)))
|
ifaceCodeSet, err := encoder.CompileToGetCodeSet(uintptr(unsafe.Pointer(typ)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -190,12 +190,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
typ *runtime.Type
|
typ *runtime.Type
|
||||||
ifacePtr unsafe.Pointer
|
ifacePtr unsafe.Pointer
|
||||||
)
|
)
|
||||||
|
up := ptrToUnsafePtr(p)
|
||||||
if code.Flags&encoder.NonEmptyInterfaceFlags != 0 {
|
if code.Flags&encoder.NonEmptyInterfaceFlags != 0 {
|
||||||
iface := (*nonEmptyInterface)(ptrToUnsafePtr(p))
|
iface := (*nonEmptyInterface)(up)
|
||||||
ifacePtr = iface.ptr
|
ifacePtr = iface.ptr
|
||||||
typ = iface.itab.typ
|
typ = iface.itab.typ
|
||||||
} else {
|
} else {
|
||||||
iface := (*emptyInterface)(ptrToUnsafePtr(p))
|
iface := (*emptyInterface)(up)
|
||||||
ifacePtr = iface.ptr
|
ifacePtr = iface.ptr
|
||||||
typ = iface.typ
|
typ = iface.typ
|
||||||
}
|
}
|
||||||
|
@ -205,7 +206,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
code = code.Next
|
code = code.Next
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
ctx.KeepRefs = append(ctx.KeepRefs, unsafe.Pointer(p))
|
ctx.KeepRefs = append(ctx.KeepRefs, up)
|
||||||
ifaceCodeSet, err := encoder.CompileToGetCodeSet(uintptr(unsafe.Pointer(typ)))
|
ifaceCodeSet, err := encoder.CompileToGetCodeSet(uintptr(unsafe.Pointer(typ)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue