mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
fix crash
This commit is contained in:
@@ -5302,6 +5302,7 @@ pub fn convertUTF8toUTF16InBuffer(
|
||||
//
|
||||
// the reason i didn't implement the fallback is purely because our
|
||||
// code in this file is too chaotic. it is left as a TODO
|
||||
if (input.len == 0) return &[_]u16{};
|
||||
const result = bun.simdutf.convert.utf8.to.utf16.le(input, buf);
|
||||
return buf[0..result];
|
||||
}
|
||||
@@ -5312,6 +5313,7 @@ pub fn convertUTF16toUTF8InBuffer(
|
||||
) ![]const u8 {
|
||||
// See above
|
||||
|
||||
if (input.len == 0) return &[_]u8{};
|
||||
const result = bun.simdutf.convert.utf16.to.utf8.le(input, buf);
|
||||
// switch (result.status) {
|
||||
// .success => return buf[0..result.count],
|
||||
|
||||
Reference in New Issue
Block a user