diff --git a/codec.go b/codec.go index 031f12f..67cc9c3 100644 --- a/codec.go +++ b/codec.go @@ -71,7 +71,6 @@ func setupCodec() error { cachedOpcodeSets = make([]*opcodeSet, addrRange) existsCachedOpcodeSets = true cachedDecoder = make([]decoder, addrRange) - existsCachedDecoder = true baseTypeAddr = min maxTypeAddr = max return nil diff --git a/decode_slice.go b/decode_slice.go index 0005434..6c26b11 100644 --- a/decode_slice.go +++ b/decode_slice.go @@ -248,7 +248,12 @@ func (d *sliceDecoder) decode(buf []byte, cursor int64, p unsafe.Pointer) (int64 } cursor++ } + case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + return 0, d.errNumber([]byte{buf[cursor]}, cursor) + default: + goto ERROR } } +ERROR: return 0, errUnexpectedEndOfJSON("slice", cursor) }