| ... | @@ -402,21 +402,33 @@ pub fn innerParse( | ... | @@ -402,21 +402,33 @@ pub fn innerParse( |
| 402 | }, | 402 | }, |
| 403 | .partial_string_escaped_1 => |arr| { | 403 | .partial_string_escaped_1 => |arr| { |
| 404 | if (i + arr.len > r.len) return error.LengthMismatch; | 404 | if (i + arr.len > r.len) return error.LengthMismatch; |
| | 405 | // tell the compiler that the by-length slice below is valid; |
| | 406 | // this assert is required for the inequality to be comptime-known |
| | 407 | if (arr.len > r.len) unreachable; |
| 405 | @memcpy(r[i..][0..arr.len], arr[0..]); | 408 | @memcpy(r[i..][0..arr.len], arr[0..]); |
| 406 | i += arr.len; | 409 | i += arr.len; |
| 407 | }, | 410 | }, |
| 408 | .partial_string_escaped_2 => |arr| { | 411 | .partial_string_escaped_2 => |arr| { |
| 409 | if (i + arr.len > r.len) return error.LengthMismatch; | 412 | if (i + arr.len > r.len) return error.LengthMismatch; |
| | 413 | // tell the compiler that the by-length slice below is valid; |
| | 414 | // this assert is required for the inequality to be comptime-known |
| | 415 | if (arr.len > r.len) unreachable; |
| 410 | @memcpy(r[i..][0..arr.len], arr[0..]); | 416 | @memcpy(r[i..][0..arr.len], arr[0..]); |
| 411 | i += arr.len; | 417 | i += arr.len; |
| 412 | }, | 418 | }, |
| 413 | .partial_string_escaped_3 => |arr| { | 419 | .partial_string_escaped_3 => |arr| { |
| 414 | if (i + arr.len > r.len) return error.LengthMismatch; | 420 | if (i + arr.len > r.len) return error.LengthMismatch; |
| | 421 | // tell the compiler that the by-length slice below is valid; |
| | 422 | // this assert is required for the inequality to be comptime-known |
| | 423 | if (arr.len > r.len) unreachable; |
| 415 | @memcpy(r[i..][0..arr.len], arr[0..]); | 424 | @memcpy(r[i..][0..arr.len], arr[0..]); |
| 416 | i += arr.len; | 425 | i += arr.len; |
| 417 | }, | 426 | }, |
| 418 | .partial_string_escaped_4 => |arr| { | 427 | .partial_string_escaped_4 => |arr| { |
| 419 | if (i + arr.len > r.len) return error.LengthMismatch; | 428 | if (i + arr.len > r.len) return error.LengthMismatch; |
| | 429 | // tell the compiler that the by-length slice below is valid; |
| | 430 | // this assert is required for the inequality to be comptime-known |
| | 431 | if (arr.len > r.len) unreachable; |
| 420 | @memcpy(r[i..][0..arr.len], arr[0..]); | 432 | @memcpy(r[i..][0..arr.len], arr[0..]); |
| 421 | i += arr.len; | 433 | i += arr.len; |
| 422 | }, | 434 | }, |