Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit7a91282

Browse files
0hmXaduh95
authored andcommitted
src: use simdjson::pad
PR-URL:#59391Refs:#59389Reviewed-By: Daniel Lemire <daniel@lemire.me>Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent2237142 commit7a91282

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

‎src/node_modules.cc‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,11 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON(
102102
if (ReadFileSync(&package_config.raw_json, path.data()) <0) {
103103
returnnullptr;
104104
}
105-
// In some systems, std::string is annotated to generate an
106-
// AddressSanitizer: container-overflow error when reading beyond the end of
107-
// the string even when we are still within the capacity of the string.
108-
// https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow
109-
// https://github.com/nodejs/node/issues/55584
110-
// The next lines are a workaround to avoid this false positive.
111-
size_t json_length = package_config.raw_json.size();
112-
package_config.raw_json.append(simdjson::SIMDJSON_PADDING,'');
113-
simdjson::padded_string_viewjson_view(package_config.raw_json.data(),
114-
json_length,
115-
package_config.raw_json.size());
116-
// End of workaround
117-
118105
simdjson::ondemand::document document;
119106
simdjson::ondemand::object main_object;
120107
simdjson::error_code error =
121-
binding_data->json_parser.iterate(json_view).get(document);
108+
binding_data->json_parser.iterate(simdjson::pad(package_config.raw_json))
109+
.get(document);
122110

123111
constauto throw_invalid_package_config = [error_context, path, realm]() {
124112
if (error_context ==nullptr) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp