Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e482d5e

Browse filesBrowse files
anonrigRafaelGSS
authored andcommitted
src: fix endianness of simdutf
PR-URL: #46257 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 26cde8e commit e482d5e
Copy full SHA for e482d5e

File tree

Expand file treeCollapse file tree

2 files changed

+4
-18
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-18
lines changed
Open diff view settings
Collapse file

‎src/node_builtins.cc‎

Copy file name to clipboardExpand all lines: src/node_builtins.cc
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ bool BuiltinLoader::Add(const char* id, std::string_view utf8source) {
248248
size_t expected_u16_length =
249249
simdutf::utf16_length_from_utf8(utf8source.data(), utf8source.length());
250250
auto out = std::make_shared<std::vector<uint16_t>>(expected_u16_length);
251-
size_t u16_length = simdutf::convert_utf8_to_utf16le(
252-
utf8source.data(),
253-
utf8source.length(),
254-
reinterpret_cast<char16_t*>(out->data()));
251+
size_t u16_length =
252+
simdutf::convert_utf8_to_utf16(utf8source.data(),
253+
utf8source.length(),
254+
reinterpret_cast<char16_t*>(out->data()));
255255
out->resize(u16_length);
256256
return Add(id, UnionBytes(out));
257257
}
Collapse file

‎test/cctest/test_util.cc‎

Copy file name to clipboardExpand all lines: test/cctest/test_util.cc
-14Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,3 @@ TEST(UtilTest, SPrintF) {
299299
const std::string with_zero = std::string("a") + '\0' + 'b';
300300
EXPECT_EQ(SPrintF("%s", with_zero), with_zero);
301301
}
302-
303-
TEST(UtilTest, SimdutfEndiannessDoesNotMeanEndianness) {
304-
// In simdutf, "LE" does *not* refer to Little Endian, it refers
305-
// to 16-byte code units that are stored using *host* endianness.
306-
// This is weird and confusing naming, and so we add this assertion
307-
// here to verify that this is actually the case (so that CI tells
308-
// us if it changed, because for most people Little Endian is
309-
// host endianness, so locally everything would work fine).
310-
const char utf8source[] = "\xe7\x8c\xab";
311-
char16_t u16output;
312-
size_t u16len = simdutf::convert_utf8_to_utf16le(utf8source, 3, &u16output);
313-
EXPECT_EQ(u16len, 1u);
314-
EXPECT_EQ(u16output, 0x732B);
315-
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.