Merge pull request #5225 from roc-lang/utf8-range-slice-offset

fix end offset of fromUtf8Range
This commit is contained in:
Brendan Hansknecht 2023-03-29 07:30:15 +00:00 committed by GitHub
commit 6714ada624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1921,7 +1921,7 @@ pub fn fromUtf8Range(arg: RocList, start: usize, count: usize, update_mode: Upda
.problem_code = Utf8ByteProblem.InvalidStartByte,
};
}
const bytes = @ptrCast([*]const u8, arg.bytes)[start..count];
const bytes = @ptrCast([*]const u8, arg.bytes)[start .. start + count];
if (isValidUnicode(bytes)) {
// Make a seamless slice of the input.