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
|
||||
} else if isPtr && typ.Implements(marshalJSONType) {
|
||||
typ = orgType
|
||||
} else if isPtr && isIntOrUintType(typ) {
|
||||
//typ = orgType
|
||||
}
|
||||
code, err := encodeCompile(ctx.withType(typ))
|
||||
if err != nil {
|
||||
|
|
|
@ -29,7 +29,12 @@ func encodeRunEscaped(ctx *encodeRuntimeContext, b []byte, codeSet *opcodeSet, o
|
|||
case opInt:
|
||||
p := load(ctxptr, code.idx)
|
||||
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 = encodeComma(b)
|
||||
code = code.next
|
||||
case opUint:
|
||||
|
|
Loading…
Reference in New Issue