File tree 2 files changed +23
-3
lines changed
2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -3985,3 +3985,23 @@ func TestIssue372(t *testing.T) {
3985
3985
t .Errorf ("unexpected result: %v != %v" , got , expected )
3986
3986
}
3987
3987
}
3988
+
3989
+ type issue384 struct {}
3990
+
3991
+ func (t * issue384 ) UnmarshalJSON (b []byte ) error {
3992
+ return nil
3993
+ }
3994
+
3995
+ func TestIssue384 (t * testing.T ) {
3996
+ testcases := []string {
3997
+ `{"data": "` + strings .Repeat ("-" , 500 ) + `\""}` ,
3998
+ `["` + strings .Repeat ("-" , 508 ) + `\""]` ,
3999
+ }
4000
+ for _ , tc := range testcases {
4001
+ dec := json .NewDecoder (strings .NewReader (tc ))
4002
+ var v issue384
4003
+ if err := dec .Decode (& v ); err != nil {
4004
+ t .Errorf ("unexpected error: %v" , err )
4005
+ }
4006
+ }
4007
+ }
Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ func (s *Stream) skipObject(depth int64) error {
280
280
if char (p , cursor ) == nul {
281
281
s .cursor = cursor
282
282
if s .read () {
283
- _ , cursor , p = s .statForRetry ()
283
+ _ , cursor , p = s .stat ()
284
284
continue
285
285
}
286
286
return errors .ErrUnexpectedEndOfJSON ("string of object" , cursor )
@@ -343,7 +343,7 @@ func (s *Stream) skipArray(depth int64) error {
343
343
if char (p , cursor ) == nul {
344
344
s .cursor = cursor
345
345
if s .read () {
346
- _ , cursor , p = s .statForRetry ()
346
+ _ , cursor , p = s .stat ()
347
347
continue
348
348
}
349
349
return errors .ErrUnexpectedEndOfJSON ("string of object" , cursor )
@@ -401,7 +401,7 @@ func (s *Stream) skipValue(depth int64) error {
401
401
if char (p , cursor ) == nul {
402
402
s .cursor = cursor
403
403
if s .read () {
404
- _ , cursor , p = s .statForRetry ()
404
+ _ , cursor , p = s .stat ()
405
405
continue
406
406
}
407
407
return errors .ErrUnexpectedEndOfJSON ("value of string" , s .totalOffset ())
You can’t perform that action at this time.
0 commit comments