Fixed JSBuffer write issues (#1175)

This commit is contained in:
Taher
2022-08-29 13:09:46 -07:00
committed by GitHub
parent 9d8fb81413
commit 8651799097
3 changed files with 44 additions and 16 deletions

View File

@@ -1402,7 +1402,7 @@ pub fn copyLatin1IntoUTF8StopOnNonASCII(buf_: []u8, comptime Type: type, latin1_
}
{
const end = latin1.ptr + latin1.len;
const end = latin1.ptr + @minimum(buf.len, latin1.len);
assert(@ptrToInt(latin1.ptr + 8) > @ptrToInt(end));
const start_ptr = @ptrToInt(buf.ptr);
const start_ptr_latin1 = @ptrToInt(latin1.ptr);