Compare commits

...

3 Commits

Author SHA1 Message Date
Masaaki Goshima 455da738a8 Add debug info 2021-03-19 12:33:14 +09:00
Masaaki Goshima 3f3c05827c Merge branch 'master' of github.com:goccy/go-json into feature/fix-bug 2021-03-19 00:40:23 +09:00
Masaaki Goshima afef1e7140 Add debug code 2021-03-18 21:48:22 +09:00
1 changed files with 12 additions and 0 deletions

View File

@ -50,6 +50,18 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet, opt
ctxptr := ctx.Ptr() ctxptr := ctx.Ptr()
code := codeSet.Code code := codeSet.Code
defer func() {
if err := recover(); err != nil {
fmt.Println("error occurred", err)
fmt.Println(codeSet.Code.Dump())
fmt.Printf("code = %+v\n", code)
fmt.Printf("ctx = %+v\n", ctx)
fmt.Println("b = ", string(b))
fmt.Println("code.op = ", code.Op, "idx = ", code.DisplayIdx, "p = ", load(ctxptr, code.Idx))
panic(err)
}
}()
for { for {
switch code.Op { switch code.Op {
default: default: