diff options
author | Luke Shumaker <lukeshu@datawire.io> | 2022-08-16 02:22:23 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@datawire.io> | 2022-08-16 02:29:04 -0600 |
commit | 9f75bb80b99f94c5c87582acb99e57c232caf01d (patch) | |
tree | 5da3c0cd1e62a09c3d77cb38dec1a67b931fa1fa /decode.go | |
parent | 8c0513a04ff3870f57bde230507aaa8c6b7e6e86 (diff) |
Run the fuzzer a bit
Diffstat (limited to 'decode.go')
-rw-r--r-- | decode.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -252,6 +252,7 @@ var ( jsonUnmarshalerType = reflect.TypeOf((*json.Unmarshaler)(nil)).Elem() textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() boolType = reflect.TypeOf(true) + float64Type = reflect.TypeOf(float64(0)) ) var kind2bits = map[reflect.Kind]int{ @@ -687,7 +688,7 @@ func (dec *Decoder) decodeAny() any { } f64, err := num.Float64() if err != nil { - panic("should not happen") + dec.panicType("number "+buf.String(), float64Type, err) } return f64 case 't', 'f': |