Merge pull request #349 from orisano/fix/#348

This commit is contained in:
Masaaki Goshima 2022-03-20 00:14:27 +09:00 committed by GitHub
commit 03950e7b0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -3878,3 +3878,14 @@ func Benchmark306(b *testing.B) {
} }
}) })
} }
func TestIssue348(t *testing.T) {
in := strings.Repeat("["+strings.Repeat(",1000", 500)[1:]+"]", 2)
dec := json.NewDecoder(strings.NewReader(in))
for dec.More() {
var foo interface{}
if err := dec.Decode(&foo); err != nil {
t.Error(err)
}
}
}

View File

@ -103,7 +103,7 @@ func (s *Stream) statForRetry() ([]byte, int64, unsafe.Pointer) {
func (s *Stream) Reset() { func (s *Stream) Reset() {
s.reset() s.reset()
s.bufSize = initBufSize s.bufSize = int64(len(s.buf))
} }
func (s *Stream) More() bool { func (s *Stream) More() bool {