diff options
author | 2023-02-09 19:06:20 -0800 | |
---|---|---|
committer | 2023-02-09 19:06:20 -0800 | |
commit | 4bedd3833d4af65b0b87e09d0d471f4f0e983cbf (patch) | |
tree | 8a1f4e9870c99971111fcfded8719e837e86001b | |
parent | 2abfa8abd2ed620986c7483c3fb8cc1bd1730f4f (diff) | |
download | bun-4bedd3833d4af65b0b87e09d0d471f4f0e983cbf.tar.gz bun-4bedd3833d4af65b0b87e09d0d471f4f0e983cbf.tar.zst bun-4bedd3833d4af65b0b87e09d0d471f4f0e983cbf.zip |
Workaround https://github.com/simdutf/simdutf/issues/213
-rw-r--r-- | src/string_immutable.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig index 5408e97bb..24be341da 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -1066,9 +1066,10 @@ pub fn toUTF16Alloc(allocator: std.mem.Allocator, bytes: []const u8, comptime fa var first_non_ascii: ?u32 = null; var output_: ?std.ArrayList(u16) = null; - if (bun.FeatureFlags.use_simdutf) { - if (bytes.len == 0) - return &[_]u16{}; + if (bun.FeatureFlags.use_simdutf and + // workaround https://github.com/simdutf/simdutf/issues/213 + bytes.len > 4) + { use_simdutf: { if (bun.simdutf.validate.ascii(bytes)) return null; |