mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
decrement when the input is invalid utf8
This commit is contained in:
parent
7304154452
commit
3537fa57d2
2 changed files with 3 additions and 4 deletions
|
@ -1018,9 +1018,9 @@ fn fromUtf8(allocator: *Allocator, arg: RocList) FromUtf8Result {
|
|||
} else {
|
||||
const temp = errorToProblem(@ptrCast([*]u8, arg.bytes), arg.length);
|
||||
|
||||
// TODO what should we do RC-wise here
|
||||
// const data_bytes = arg.len();
|
||||
// utils.decref(allocator, @alignOf(usize), arg.list_bytes, data_bytes);
|
||||
// consume the input list
|
||||
const data_bytes = arg.len();
|
||||
utils.decref(allocator, @alignOf(usize), arg.bytes, data_bytes);
|
||||
|
||||
return FromUtf8Result{ .is_ok = false, .string = RocStr.empty(), .byte_index = temp.index, .problem_code = temp.problem };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue