diff --git a/iter_skip_strict.go b/iter_skip_strict.go index f67bc2e..6cf66d0 100644 --- a/iter_skip_strict.go +++ b/iter_skip_strict.go @@ -2,12 +2,22 @@ package jsoniter -import "fmt" +import ( + "fmt" + "io" +) func (iter *Iterator) skipNumber() { if !iter.trySkipNumber() { iter.unreadByte() - iter.ReadFloat32() + if iter.Error != nil && iter.Error != io.EOF { + return + } + iter.ReadFloat64() + if iter.Error != nil && iter.Error != io.EOF { + iter.Error = nil + iter.ReadBigFloat() + } } } diff --git a/value_tests/raw_message_test.go b/value_tests/raw_message_test.go index eb769a1..ff46e64 100644 --- a/value_tests/raw_message_test.go +++ b/value_tests/raw_message_test.go @@ -17,5 +17,8 @@ func init() { unmarshalCases = append(unmarshalCases, unmarshalCase{ ptr: (*json.RawMessage)(nil), input: `[1,2,3]`, + }, unmarshalCase{ + ptr: (*json.RawMessage)(nil), + input: `1.122e+250`, }) }