forked from mirror/go-json
WIP: workaround
This commit is contained in:
parent
0272fd00f4
commit
413c811e37
|
@ -104,8 +104,6 @@ func encodeCompileHead(ctx *encodeCompileContext) (*opcode, error) {
|
||||||
typ = orgType
|
typ = orgType
|
||||||
} else if isPtr && typ.Implements(marshalJSONType) {
|
} else if isPtr && typ.Implements(marshalJSONType) {
|
||||||
typ = orgType
|
typ = orgType
|
||||||
} else if isPtr && isIntOrUintType(typ) {
|
|
||||||
//typ = orgType
|
|
||||||
}
|
}
|
||||||
code, err := encodeCompile(ctx.withType(typ))
|
code, err := encodeCompile(ctx.withType(typ))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -29,7 +29,12 @@ func encodeRunEscaped(ctx *encodeRuntimeContext, b []byte, codeSet *opcodeSet, o
|
||||||
case opInt:
|
case opInt:
|
||||||
p := load(ctxptr, code.idx)
|
p := load(ctxptr, code.idx)
|
||||||
u64 := ptrToUint64(p)
|
u64 := ptrToUint64(p)
|
||||||
|
if (u64>>code.rshiftNum)&1 == 1 {
|
||||||
|
v := ^u64&code.mask + 1
|
||||||
|
b = appendInt(b, -v, true)
|
||||||
|
} else {
|
||||||
b = appendInt(b, u64&code.mask, (u64>>code.rshiftNum)&1 == 1)
|
b = appendInt(b, u64&code.mask, (u64>>code.rshiftNum)&1 == 1)
|
||||||
|
}
|
||||||
b = encodeComma(b)
|
b = encodeComma(b)
|
||||||
code = code.next
|
code = code.next
|
||||||
case opUint:
|
case opUint:
|
||||||
|
|
Loading…
Reference in New Issue