| ... | @@ -1384,7 +1384,7 @@ fn ParseInternalErrorImpl(comptime T: type, comptime inferred_types: []const typ | ... | @@ -1384,7 +1384,7 @@ fn ParseInternalErrorImpl(comptime T: type, comptime inferred_types: []const typ |
| 1384 | return errors; | 1384 | return errors; |
| 1385 | }, | 1385 | }, |
| 1386 | .Array => |arrayInfo| { | 1386 | .Array => |arrayInfo| { |
| 1387 | return error{ UnexpectedEndOfJson, UnexpectedToken } || TokenStream.Error || | 1387 | return error{ UnexpectedEndOfJson, UnexpectedToken, LengthMismatch } || TokenStream.Error || |
| 1388 | UnescapeValidStringError || | 1388 | UnescapeValidStringError || |
| 1389 | ParseInternalErrorImpl(arrayInfo.child, inferred_types ++ [_]type{T}); | 1389 | ParseInternalErrorImpl(arrayInfo.child, inferred_types ++ [_]type{T}); |
| 1390 | }, | 1390 | }, |
| ... | @@ -1625,6 +1625,7 @@ fn parseInternal( | ... | @@ -1625,6 +1625,7 @@ fn parseInternal( |
| 1625 | if (arrayInfo.child != u8) return error.UnexpectedToken; | 1625 | if (arrayInfo.child != u8) return error.UnexpectedToken; |
| 1626 | var r: T = undefined; | 1626 | var r: T = undefined; |
| 1627 | const source_slice = stringToken.slice(tokens.slice, tokens.i - 1); | 1627 | const source_slice = stringToken.slice(tokens.slice, tokens.i - 1); |
| | 1628 | if (r.len != stringToken.decodedLength()) return error.LengthMismatch; |
| 1628 | switch (stringToken.escapes) { | 1629 | switch (stringToken.escapes) { |
| 1629 | .None => mem.copy(u8, &r, source_slice), | 1630 | .None => mem.copy(u8, &r, source_slice), |
| 1630 | .Some => try unescapeValidString(&r, source_slice), | 1631 | .Some => try unescapeValidString(&r, source_slice), |