Commit 21f79ce

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update simdjson to 4.6.6
PR-URL: #64942 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7a4960d commit 21f79ce

2 files changed

Lines changed: 139 additions & 19 deletions

File tree

β€Ždeps/simdjson/simdjson.cppβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.cpp: */
33
/* begin file simdjson.cpp */
44
#define SIMDJSON_SRC_SIMDJSON_CPP

β€Ždeps/simdjson/simdjson.hβ€Ž

Lines changed: 138 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.h: */
33
/* begin file simdjson.h */
44
#ifndef SIMDJSON_H
@@ -2538,7 +2538,7 @@ namespace std {
25382538
#define SIMDJSON_SIMDJSON_VERSION_H
25392539

25402540
/** The version of simdjson being used (major.minor.revision) */
2541-
#define SIMDJSON_VERSION "4.6.4"
2541+
#define SIMDJSON_VERSION "4.6.6"
25422542

25432543
namespace simdjson {
25442544
enum {
@@ -2553,7 +2553,7 @@ enum {
25532553
/**
25542554
* The revision (major.minor.REVISION) of simdjson being used.
25552555
*/
2556-
SIMDJSON_VERSION_REVISION = 4
2556+
SIMDJSON_VERSION_REVISION = 6
25572557
};
25582558
} // namespace simdjson
25592559

@@ -8067,16 +8067,28 @@ inline std::pair<std::string_view, std::string_view> get_next_key_and_json_path(
80678067
}
80688068

80698069
key = json_path.substr(key_start, i - key_start);
8070-
} else if ((i+1 < json_path.size()) && json_path[i] == '[' && (json_path[i+1] == '\'' || json_path[i+1] == '"')) {
8070+
} else if ((i + 1 < json_path.size()) && json_path[i] == '[' &&
8071+
(json_path[i + 1] == '\'' || json_path[i + 1] == '"')) {
8072+
// Bracket-quoted key: ['key'] or ["key"].
8073+
// Require a matching closing quote and a following ']'. If either is
8074+
// missing, return an empty key and the original path so callers can treat
8075+
// this as a parse failure (e.g. INVALID_JSON_POINTER) without advancing.
8076+
// Without this check, i += 2 can make i > size() and substr throws
8077+
// std::out_of_range, which aborts noexcept callers such as
8078+
// at_path_with_wildcard / for_each_at_path_with_wildcard.
8079+
const char quote = json_path[i + 1];
80718080
i += 2;
8072-
size_t key_start = i;
8073-
while (i < json_path.length() && json_path[i] != '\'' && json_path[i] != '"') {
8081+
const size_t key_start = i;
8082+
while (i < json_path.length() && json_path[i] != quote) {
80748083
++i;
80758084
}
8076-
8085+
if (i >= json_path.length() || // missing closing quote
8086+
i + 1 >= json_path.length() || // missing ]
8087+
json_path[i + 1] != ']') {
8088+
return {key, json_path};
8089+
}
80778090
key = json_path.substr(key_start, i - key_start);
8078-
8079-
i += 2;
8091+
i += 2; // past quote and ]
80808092
} else if ((i+2 < json_path.size()) && json_path[i] == '[' && json_path[i+1] == '*' && json_path[i+2] == ']') { // i.e [*].additional_keys or [*]["additional_keys"]
80818093
key = "*";
80828094
i += 3;
@@ -68653,6 +68665,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
6865368665
auto result_pair = get_next_key_and_json_path(json_path);
6865468666
std::string_view key = result_pair.first;
6865568667
std::string_view remaining_path = result_pair.second;
68668+
// Empty key means the path segment could not be parsed (including malformed
68669+
// bracket-quoted keys). Without this check, an empty key is treated as index
68670+
// 0 and remaining_path may be unchanged, causing infinite recursion.
68671+
if (key.empty()) {
68672+
return INVALID_JSON_POINTER;
68673+
}
6865668674
// Wildcard case
6865768675
if (key=="*"){
6865868676
for(auto element: *this) {
@@ -72182,6 +72200,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
7218272200
auto result_pair = get_next_key_and_json_path(json_path);
7218372201
std::string_view key = result_pair.first;
7218472202
std::string_view remaining_path = result_pair.second;
72203+
// Empty key means the path segment could not be parsed (including malformed
72204+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
72205+
// "no progress" as a recursive lookup of "".
72206+
if (key.empty()) {
72207+
return INVALID_JSON_POINTER;
72208+
}
7218572209
// Handle when its the case for wildcard
7218672210
if (key == "*") {
7218772211
// Loop through each field in the object
@@ -72547,7 +72571,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
7254772571

7254872572
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
7254972573
if (new_capacity > max_capacity()) { return CAPACITY; }
72550-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
72574+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
7255172575

7255272576
// string_capacity copied from document::allocate
7255372577
_capacity = 0;
@@ -82023,6 +82047,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
8202382047
auto result_pair = get_next_key_and_json_path(json_path);
8202482048
std::string_view key = result_pair.first;
8202582049
std::string_view remaining_path = result_pair.second;
82050+
// Empty key means the path segment could not be parsed (including malformed
82051+
// bracket-quoted keys). Without this check, an empty key is treated as index
82052+
// 0 and remaining_path may be unchanged, causing infinite recursion.
82053+
if (key.empty()) {
82054+
return INVALID_JSON_POINTER;
82055+
}
8202682056
// Wildcard case
8202782057
if (key=="*"){
8202882058
for(auto element: *this) {
@@ -85552,6 +85582,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
8555285582
auto result_pair = get_next_key_and_json_path(json_path);
8555385583
std::string_view key = result_pair.first;
8555485584
std::string_view remaining_path = result_pair.second;
85585+
// Empty key means the path segment could not be parsed (including malformed
85586+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
85587+
// "no progress" as a recursive lookup of "".
85588+
if (key.empty()) {
85589+
return INVALID_JSON_POINTER;
85590+
}
8555585591
// Handle when its the case for wildcard
8555685592
if (key == "*") {
8555785593
// Loop through each field in the object
@@ -85917,7 +85953,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
8591785953

8591885954
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
8591985955
if (new_capacity > max_capacity()) { return CAPACITY; }
85920-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
85956+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
8592185957

8592285958
// string_capacity copied from document::allocate
8592385959
_capacity = 0;
@@ -95880,6 +95916,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
9588095916
auto result_pair = get_next_key_and_json_path(json_path);
9588195917
std::string_view key = result_pair.first;
9588295918
std::string_view remaining_path = result_pair.second;
95919+
// Empty key means the path segment could not be parsed (including malformed
95920+
// bracket-quoted keys). Without this check, an empty key is treated as index
95921+
// 0 and remaining_path may be unchanged, causing infinite recursion.
95922+
if (key.empty()) {
95923+
return INVALID_JSON_POINTER;
95924+
}
9588395925
// Wildcard case
9588495926
if (key=="*"){
9588595927
for(auto element: *this) {
@@ -99409,6 +99451,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
9940999451
auto result_pair = get_next_key_and_json_path(json_path);
9941099452
std::string_view key = result_pair.first;
9941199453
std::string_view remaining_path = result_pair.second;
99454+
// Empty key means the path segment could not be parsed (including malformed
99455+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
99456+
// "no progress" as a recursive lookup of "".
99457+
if (key.empty()) {
99458+
return INVALID_JSON_POINTER;
99459+
}
9941299460
// Handle when its the case for wildcard
9941399461
if (key == "*") {
9941499462
// Loop through each field in the object
@@ -99774,7 +99822,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
9977499822

9977599823
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
9977699824
if (new_capacity > max_capacity()) { return CAPACITY; }
99777-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
99825+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
9977899826

9977999827
// string_capacity copied from document::allocate
9978099828
_capacity = 0;
@@ -109737,6 +109785,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
109737109785
auto result_pair = get_next_key_and_json_path(json_path);
109738109786
std::string_view key = result_pair.first;
109739109787
std::string_view remaining_path = result_pair.second;
109788+
// Empty key means the path segment could not be parsed (including malformed
109789+
// bracket-quoted keys). Without this check, an empty key is treated as index
109790+
// 0 and remaining_path may be unchanged, causing infinite recursion.
109791+
if (key.empty()) {
109792+
return INVALID_JSON_POINTER;
109793+
}
109740109794
// Wildcard case
109741109795
if (key=="*"){
109742109796
for(auto element: *this) {
@@ -113266,6 +113320,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
113266113320
auto result_pair = get_next_key_and_json_path(json_path);
113267113321
std::string_view key = result_pair.first;
113268113322
std::string_view remaining_path = result_pair.second;
113323+
// Empty key means the path segment could not be parsed (including malformed
113324+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
113325+
// "no progress" as a recursive lookup of "".
113326+
if (key.empty()) {
113327+
return INVALID_JSON_POINTER;
113328+
}
113269113329
// Handle when its the case for wildcard
113270113330
if (key == "*") {
113271113331
// Loop through each field in the object
@@ -113631,7 +113691,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
113631113691

113632113692
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
113633113693
if (new_capacity > max_capacity()) { return CAPACITY; }
113634-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
113694+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
113635113695

113636113696
// string_capacity copied from document::allocate
113637113697
_capacity = 0;
@@ -123709,6 +123769,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
123709123769
auto result_pair = get_next_key_and_json_path(json_path);
123710123770
std::string_view key = result_pair.first;
123711123771
std::string_view remaining_path = result_pair.second;
123772+
// Empty key means the path segment could not be parsed (including malformed
123773+
// bracket-quoted keys). Without this check, an empty key is treated as index
123774+
// 0 and remaining_path may be unchanged, causing infinite recursion.
123775+
if (key.empty()) {
123776+
return INVALID_JSON_POINTER;
123777+
}
123712123778
// Wildcard case
123713123779
if (key=="*"){
123714123780
for(auto element: *this) {
@@ -127238,6 +127304,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
127238127304
auto result_pair = get_next_key_and_json_path(json_path);
127239127305
std::string_view key = result_pair.first;
127240127306
std::string_view remaining_path = result_pair.second;
127307+
// Empty key means the path segment could not be parsed (including malformed
127308+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
127309+
// "no progress" as a recursive lookup of "".
127310+
if (key.empty()) {
127311+
return INVALID_JSON_POINTER;
127312+
}
127241127313
// Handle when its the case for wildcard
127242127314
if (key == "*") {
127243127315
// Loop through each field in the object
@@ -127603,7 +127675,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
127603127675

127604127676
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
127605127677
if (new_capacity > max_capacity()) { return CAPACITY; }
127606-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
127678+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
127607127679

127608127680
// string_capacity copied from document::allocate
127609127681
_capacity = 0;
@@ -137998,6 +138070,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
137998138070
auto result_pair = get_next_key_and_json_path(json_path);
137999138071
std::string_view key = result_pair.first;
138000138072
std::string_view remaining_path = result_pair.second;
138073+
// Empty key means the path segment could not be parsed (including malformed
138074+
// bracket-quoted keys). Without this check, an empty key is treated as index
138075+
// 0 and remaining_path may be unchanged, causing infinite recursion.
138076+
if (key.empty()) {
138077+
return INVALID_JSON_POINTER;
138078+
}
138001138079
// Wildcard case
138002138080
if (key=="*"){
138003138081
for(auto element: *this) {
@@ -141527,6 +141605,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
141527141605
auto result_pair = get_next_key_and_json_path(json_path);
141528141606
std::string_view key = result_pair.first;
141529141607
std::string_view remaining_path = result_pair.second;
141608+
// Empty key means the path segment could not be parsed (including malformed
141609+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
141610+
// "no progress" as a recursive lookup of "".
141611+
if (key.empty()) {
141612+
return INVALID_JSON_POINTER;
141613+
}
141530141614
// Handle when its the case for wildcard
141531141615
if (key == "*") {
141532141616
// Loop through each field in the object
@@ -141892,7 +141976,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
141892141976

141893141977
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
141894141978
if (new_capacity > max_capacity()) { return CAPACITY; }
141895-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
141979+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
141896141980

141897141981
// string_capacity copied from document::allocate
141898141982
_capacity = 0;
@@ -151761,6 +151845,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
151761151845
auto result_pair = get_next_key_and_json_path(json_path);
151762151846
std::string_view key = result_pair.first;
151763151847
std::string_view remaining_path = result_pair.second;
151848+
// Empty key means the path segment could not be parsed (including malformed
151849+
// bracket-quoted keys). Without this check, an empty key is treated as index
151850+
// 0 and remaining_path may be unchanged, causing infinite recursion.
151851+
if (key.empty()) {
151852+
return INVALID_JSON_POINTER;
151853+
}
151764151854
// Wildcard case
151765151855
if (key=="*"){
151766151856
for(auto element: *this) {
@@ -155290,6 +155380,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
155290155380
auto result_pair = get_next_key_and_json_path(json_path);
155291155381
std::string_view key = result_pair.first;
155292155382
std::string_view remaining_path = result_pair.second;
155383+
// Empty key means the path segment could not be parsed (including malformed
155384+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
155385+
// "no progress" as a recursive lookup of "".
155386+
if (key.empty()) {
155387+
return INVALID_JSON_POINTER;
155388+
}
155293155389
// Handle when its the case for wildcard
155294155390
if (key == "*") {
155295155391
// Loop through each field in the object
@@ -155655,7 +155751,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
155655155751

155656155752
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
155657155753
if (new_capacity > max_capacity()) { return CAPACITY; }
155658-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
155754+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
155659155755

155660155756
// string_capacity copied from document::allocate
155661155757
_capacity = 0;
@@ -165547,6 +165643,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
165547165643
auto result_pair = get_next_key_and_json_path(json_path);
165548165644
std::string_view key = result_pair.first;
165549165645
std::string_view remaining_path = result_pair.second;
165646+
// Empty key means the path segment could not be parsed (including malformed
165647+
// bracket-quoted keys). Without this check, an empty key is treated as index
165648+
// 0 and remaining_path may be unchanged, causing infinite recursion.
165649+
if (key.empty()) {
165650+
return INVALID_JSON_POINTER;
165651+
}
165550165652
// Wildcard case
165551165653
if (key=="*"){
165552165654
for(auto element: *this) {
@@ -169076,6 +169178,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
169076169178
auto result_pair = get_next_key_and_json_path(json_path);
169077169179
std::string_view key = result_pair.first;
169078169180
std::string_view remaining_path = result_pair.second;
169181+
// Empty key means the path segment could not be parsed (including malformed
169182+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
169183+
// "no progress" as a recursive lookup of "".
169184+
if (key.empty()) {
169185+
return INVALID_JSON_POINTER;
169186+
}
169079169187
// Handle when its the case for wildcard
169080169188
if (key == "*") {
169081169189
// Loop through each field in the object
@@ -169441,7 +169549,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
169441169549

169442169550
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
169443169551
if (new_capacity > max_capacity()) { return CAPACITY; }
169444-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
169552+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
169445169553

169446169554
// string_capacity copied from document::allocate
169447169555
_capacity = 0;
@@ -179337,6 +179445,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
179337179445
auto result_pair = get_next_key_and_json_path(json_path);
179338179446
std::string_view key = result_pair.first;
179339179447
std::string_view remaining_path = result_pair.second;
179448+
// Empty key means the path segment could not be parsed (including malformed
179449+
// bracket-quoted keys). Without this check, an empty key is treated as index
179450+
// 0 and remaining_path may be unchanged, causing infinite recursion.
179451+
if (key.empty()) {
179452+
return INVALID_JSON_POINTER;
179453+
}
179340179454
// Wildcard case
179341179455
if (key=="*"){
179342179456
for(auto element: *this) {
@@ -182866,6 +182980,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
182866182980
auto result_pair = get_next_key_and_json_path(json_path);
182867182981
std::string_view key = result_pair.first;
182868182982
std::string_view remaining_path = result_pair.second;
182983+
// Empty key means the path segment could not be parsed (including malformed
182984+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
182985+
// "no progress" as a recursive lookup of "".
182986+
if (key.empty()) {
182987+
return INVALID_JSON_POINTER;
182988+
}
182869182989
// Handle when its the case for wildcard
182870182990
if (key == "*") {
182871182991
// Loop through each field in the object
@@ -183231,7 +183351,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
183231183351

183232183352
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
183233183353
if (new_capacity > max_capacity()) { return CAPACITY; }
183234-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
183354+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
183235183355

183236183356
// string_capacity copied from document::allocate
183237183357
_capacity = 0;

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Commit 21f79ce

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update simdjson to 4.6.6
PR-URL: #64942 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7a4960d commit 21f79ce

2 files changed

Lines changed: 139 additions & 19 deletions

File tree

β€Ždeps/simdjson/simdjson.cppβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.cpp: */
33
/* begin file simdjson.cpp */
44
#define SIMDJSON_SRC_SIMDJSON_CPP

β€Ždeps/simdjson/simdjson.hβ€Ž

Lines changed: 138 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.h: */
33
/* begin file simdjson.h */
44
#ifndef SIMDJSON_H
@@ -2538,7 +2538,7 @@ namespace std {
25382538
#define SIMDJSON_SIMDJSON_VERSION_H
25392539

25402540
/** The version of simdjson being used (major.minor.revision) */
2541-
#define SIMDJSON_VERSION "4.6.4"
2541+
#define SIMDJSON_VERSION "4.6.6"
25422542

25432543
namespace simdjson {
25442544
enum {
@@ -2553,7 +2553,7 @@ enum {
25532553
/**
25542554
* The revision (major.minor.REVISION) of simdjson being used.
25552555
*/
2556-
SIMDJSON_VERSION_REVISION = 4
2556+
SIMDJSON_VERSION_REVISION = 6
25572557
};
25582558
} // namespace simdjson
25592559

@@ -8067,16 +8067,28 @@ inline std::pair<std::string_view, std::string_view> get_next_key_and_json_path(
80678067
}
80688068

80698069
key = json_path.substr(key_start, i - key_start);
8070-
} else if ((i+1 < json_path.size()) && json_path[i] == '[' && (json_path[i+1] == '\'' || json_path[i+1] == '"')) {
8070+
} else if ((i + 1 < json_path.size()) && json_path[i] == '[' &&
8071+
(json_path[i + 1] == '\'' || json_path[i + 1] == '"')) {
8072+
// Bracket-quoted key: ['key'] or ["key"].
8073+
// Require a matching closing quote and a following ']'. If either is
8074+
// missing, return an empty key and the original path so callers can treat
8075+
// this as a parse failure (e.g. INVALID_JSON_POINTER) without advancing.
8076+
// Without this check, i += 2 can make i > size() and substr throws
8077+
// std::out_of_range, which aborts noexcept callers such as
8078+
// at_path_with_wildcard / for_each_at_path_with_wildcard.
8079+
const char quote = json_path[i + 1];
80718080
i += 2;
8072-
size_t key_start = i;
8073-
while (i < json_path.length() && json_path[i] != '\'' && json_path[i] != '"') {
8081+
const size_t key_start = i;
8082+
while (i < json_path.length() && json_path[i] != quote) {
80748083
++i;
80758084
}
8076-
8085+
if (i >= json_path.length() || // missing closing quote
8086+
i + 1 >= json_path.length() || // missing ]
8087+
json_path[i + 1] != ']') {
8088+
return {key, json_path};
8089+
}
80778090
key = json_path.substr(key_start, i - key_start);
8078-
8079-
i += 2;
8091+
i += 2; // past quote and ]
80808092
} else if ((i+2 < json_path.size()) && json_path[i] == '[' && json_path[i+1] == '*' && json_path[i+2] == ']') { // i.e [*].additional_keys or [*]["additional_keys"]
80818093
key = "*";
80828094
i += 3;
@@ -68653,6 +68665,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
6865368665
auto result_pair = get_next_key_and_json_path(json_path);
6865468666
std::string_view key = result_pair.first;
6865568667
std::string_view remaining_path = result_pair.second;
68668+
// Empty key means the path segment could not be parsed (including malformed
68669+
// bracket-quoted keys). Without this check, an empty key is treated as index
68670+
// 0 and remaining_path may be unchanged, causing infinite recursion.
68671+
if (key.empty()) {
68672+
return INVALID_JSON_POINTER;
68673+
}
6865668674
// Wildcard case
6865768675
if (key=="*"){
6865868676
for(auto element: *this) {
@@ -72182,6 +72200,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
7218272200
auto result_pair = get_next_key_and_json_path(json_path);
7218372201
std::string_view key = result_pair.first;
7218472202
std::string_view remaining_path = result_pair.second;
72203+
// Empty key means the path segment could not be parsed (including malformed
72204+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
72205+
// "no progress" as a recursive lookup of "".
72206+
if (key.empty()) {
72207+
return INVALID_JSON_POINTER;
72208+
}
7218572209
// Handle when its the case for wildcard
7218672210
if (key == "*") {
7218772211
// Loop through each field in the object
@@ -72547,7 +72571,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
7254772571

7254872572
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
7254972573
if (new_capacity > max_capacity()) { return CAPACITY; }
72550-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
72574+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
7255172575

7255272576
// string_capacity copied from document::allocate
7255372577
_capacity = 0;
@@ -82023,6 +82047,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
8202382047
auto result_pair = get_next_key_and_json_path(json_path);
8202482048
std::string_view key = result_pair.first;
8202582049
std::string_view remaining_path = result_pair.second;
82050+
// Empty key means the path segment could not be parsed (including malformed
82051+
// bracket-quoted keys). Without this check, an empty key is treated as index
82052+
// 0 and remaining_path may be unchanged, causing infinite recursion.
82053+
if (key.empty()) {
82054+
return INVALID_JSON_POINTER;
82055+
}
8202682056
// Wildcard case
8202782057
if (key=="*"){
8202882058
for(auto element: *this) {
@@ -85552,6 +85582,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
8555285582
auto result_pair = get_next_key_and_json_path(json_path);
8555385583
std::string_view key = result_pair.first;
8555485584
std::string_view remaining_path = result_pair.second;
85585+
// Empty key means the path segment could not be parsed (including malformed
85586+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
85587+
// "no progress" as a recursive lookup of "".
85588+
if (key.empty()) {
85589+
return INVALID_JSON_POINTER;
85590+
}
8555585591
// Handle when its the case for wildcard
8555685592
if (key == "*") {
8555785593
// Loop through each field in the object
@@ -85917,7 +85953,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
8591785953

8591885954
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
8591985955
if (new_capacity > max_capacity()) { return CAPACITY; }
85920-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
85956+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
8592185957

8592285958
// string_capacity copied from document::allocate
8592385959
_capacity = 0;
@@ -95880,6 +95916,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
9588095916
auto result_pair = get_next_key_and_json_path(json_path);
9588195917
std::string_view key = result_pair.first;
9588295918
std::string_view remaining_path = result_pair.second;
95919+
// Empty key means the path segment could not be parsed (including malformed
95920+
// bracket-quoted keys). Without this check, an empty key is treated as index
95921+
// 0 and remaining_path may be unchanged, causing infinite recursion.
95922+
if (key.empty()) {
95923+
return INVALID_JSON_POINTER;
95924+
}
9588395925
// Wildcard case
9588495926
if (key=="*"){
9588595927
for(auto element: *this) {
@@ -99409,6 +99451,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
9940999451
auto result_pair = get_next_key_and_json_path(json_path);
9941099452
std::string_view key = result_pair.first;
9941199453
std::string_view remaining_path = result_pair.second;
99454+
// Empty key means the path segment could not be parsed (including malformed
99455+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
99456+
// "no progress" as a recursive lookup of "".
99457+
if (key.empty()) {
99458+
return INVALID_JSON_POINTER;
99459+
}
9941299460
// Handle when its the case for wildcard
9941399461
if (key == "*") {
9941499462
// Loop through each field in the object
@@ -99774,7 +99822,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
9977499822

9977599823
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
9977699824
if (new_capacity > max_capacity()) { return CAPACITY; }
99777-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
99825+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
9977899826

9977999827
// string_capacity copied from document::allocate
9978099828
_capacity = 0;
@@ -109737,6 +109785,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
109737109785
auto result_pair = get_next_key_and_json_path(json_path);
109738109786
std::string_view key = result_pair.first;
109739109787
std::string_view remaining_path = result_pair.second;
109788+
// Empty key means the path segment could not be parsed (including malformed
109789+
// bracket-quoted keys). Without this check, an empty key is treated as index
109790+
// 0 and remaining_path may be unchanged, causing infinite recursion.
109791+
if (key.empty()) {
109792+
return INVALID_JSON_POINTER;
109793+
}
109740109794
// Wildcard case
109741109795
if (key=="*"){
109742109796
for(auto element: *this) {
@@ -113266,6 +113320,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
113266113320
auto result_pair = get_next_key_and_json_path(json_path);
113267113321
std::string_view key = result_pair.first;
113268113322
std::string_view remaining_path = result_pair.second;
113323+
// Empty key means the path segment could not be parsed (including malformed
113324+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
113325+
// "no progress" as a recursive lookup of "".
113326+
if (key.empty()) {
113327+
return INVALID_JSON_POINTER;
113328+
}
113269113329
// Handle when its the case for wildcard
113270113330
if (key == "*") {
113271113331
// Loop through each field in the object
@@ -113631,7 +113691,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
113631113691

113632113692
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
113633113693
if (new_capacity > max_capacity()) { return CAPACITY; }
113634-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
113694+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
113635113695

113636113696
// string_capacity copied from document::allocate
113637113697
_capacity = 0;
@@ -123709,6 +123769,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
123709123769
auto result_pair = get_next_key_and_json_path(json_path);
123710123770
std::string_view key = result_pair.first;
123711123771
std::string_view remaining_path = result_pair.second;
123772+
// Empty key means the path segment could not be parsed (including malformed
123773+
// bracket-quoted keys). Without this check, an empty key is treated as index
123774+
// 0 and remaining_path may be unchanged, causing infinite recursion.
123775+
if (key.empty()) {
123776+
return INVALID_JSON_POINTER;
123777+
}
123712123778
// Wildcard case
123713123779
if (key=="*"){
123714123780
for(auto element: *this) {
@@ -127238,6 +127304,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
127238127304
auto result_pair = get_next_key_and_json_path(json_path);
127239127305
std::string_view key = result_pair.first;
127240127306
std::string_view remaining_path = result_pair.second;
127307+
// Empty key means the path segment could not be parsed (including malformed
127308+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
127309+
// "no progress" as a recursive lookup of "".
127310+
if (key.empty()) {
127311+
return INVALID_JSON_POINTER;
127312+
}
127241127313
// Handle when its the case for wildcard
127242127314
if (key == "*") {
127243127315
// Loop through each field in the object
@@ -127603,7 +127675,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
127603127675

127604127676
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
127605127677
if (new_capacity > max_capacity()) { return CAPACITY; }
127606-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
127678+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
127607127679

127608127680
// string_capacity copied from document::allocate
127609127681
_capacity = 0;
@@ -137998,6 +138070,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
137998138070
auto result_pair = get_next_key_and_json_path(json_path);
137999138071
std::string_view key = result_pair.first;
138000138072
std::string_view remaining_path = result_pair.second;
138073+
// Empty key means the path segment could not be parsed (including malformed
138074+
// bracket-quoted keys). Without this check, an empty key is treated as index
138075+
// 0 and remaining_path may be unchanged, causing infinite recursion.
138076+
if (key.empty()) {
138077+
return INVALID_JSON_POINTER;
138078+
}
138001138079
// Wildcard case
138002138080
if (key=="*"){
138003138081
for(auto element: *this) {
@@ -141527,6 +141605,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
141527141605
auto result_pair = get_next_key_and_json_path(json_path);
141528141606
std::string_view key = result_pair.first;
141529141607
std::string_view remaining_path = result_pair.second;
141608+
// Empty key means the path segment could not be parsed (including malformed
141609+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
141610+
// "no progress" as a recursive lookup of "".
141611+
if (key.empty()) {
141612+
return INVALID_JSON_POINTER;
141613+
}
141530141614
// Handle when its the case for wildcard
141531141615
if (key == "*") {
141532141616
// Loop through each field in the object
@@ -141892,7 +141976,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
141892141976

141893141977
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
141894141978
if (new_capacity > max_capacity()) { return CAPACITY; }
141895-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
141979+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
141896141980

141897141981
// string_capacity copied from document::allocate
141898141982
_capacity = 0;
@@ -151761,6 +151845,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
151761151845
auto result_pair = get_next_key_and_json_path(json_path);
151762151846
std::string_view key = result_pair.first;
151763151847
std::string_view remaining_path = result_pair.second;
151848+
// Empty key means the path segment could not be parsed (including malformed
151849+
// bracket-quoted keys). Without this check, an empty key is treated as index
151850+
// 0 and remaining_path may be unchanged, causing infinite recursion.
151851+
if (key.empty()) {
151852+
return INVALID_JSON_POINTER;
151853+
}
151764151854
// Wildcard case
151765151855
if (key=="*"){
151766151856
for(auto element: *this) {
@@ -155290,6 +155380,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
155290155380
auto result_pair = get_next_key_and_json_path(json_path);
155291155381
std::string_view key = result_pair.first;
155292155382
std::string_view remaining_path = result_pair.second;
155383+
// Empty key means the path segment could not be parsed (including malformed
155384+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
155385+
// "no progress" as a recursive lookup of "".
155386+
if (key.empty()) {
155387+
return INVALID_JSON_POINTER;
155388+
}
155293155389
// Handle when its the case for wildcard
155294155390
if (key == "*") {
155295155391
// Loop through each field in the object
@@ -155655,7 +155751,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
155655155751

155656155752
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
155657155753
if (new_capacity > max_capacity()) { return CAPACITY; }
155658-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
155754+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
155659155755

155660155756
// string_capacity copied from document::allocate
155661155757
_capacity = 0;
@@ -165547,6 +165643,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
165547165643
auto result_pair = get_next_key_and_json_path(json_path);
165548165644
std::string_view key = result_pair.first;
165549165645
std::string_view remaining_path = result_pair.second;
165646+
// Empty key means the path segment could not be parsed (including malformed
165647+
// bracket-quoted keys). Without this check, an empty key is treated as index
165648+
// 0 and remaining_path may be unchanged, causing infinite recursion.
165649+
if (key.empty()) {
165650+
return INVALID_JSON_POINTER;
165651+
}
165550165652
// Wildcard case
165551165653
if (key=="*"){
165552165654
for(auto element: *this) {
@@ -169076,6 +169178,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
169076169178
auto result_pair = get_next_key_and_json_path(json_path);
169077169179
std::string_view key = result_pair.first;
169078169180
std::string_view remaining_path = result_pair.second;
169181+
// Empty key means the path segment could not be parsed (including malformed
169182+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
169183+
// "no progress" as a recursive lookup of "".
169184+
if (key.empty()) {
169185+
return INVALID_JSON_POINTER;
169186+
}
169079169187
// Handle when its the case for wildcard
169080169188
if (key == "*") {
169081169189
// Loop through each field in the object
@@ -169441,7 +169549,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
169441169549

169442169550
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
169443169551
if (new_capacity > max_capacity()) { return CAPACITY; }
169444-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
169552+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
169445169553

169446169554
// string_capacity copied from document::allocate
169447169555
_capacity = 0;
@@ -179337,6 +179445,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
179337179445
auto result_pair = get_next_key_and_json_path(json_path);
179338179446
std::string_view key = result_pair.first;
179339179447
std::string_view remaining_path = result_pair.second;
179448+
// Empty key means the path segment could not be parsed (including malformed
179449+
// bracket-quoted keys). Without this check, an empty key is treated as index
179450+
// 0 and remaining_path may be unchanged, causing infinite recursion.
179451+
if (key.empty()) {
179452+
return INVALID_JSON_POINTER;
179453+
}
179340179454
// Wildcard case
179341179455
if (key=="*"){
179342179456
for(auto element: *this) {
@@ -182866,6 +182980,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
182866182980
auto result_pair = get_next_key_and_json_path(json_path);
182867182981
std::string_view key = result_pair.first;
182868182982
std::string_view remaining_path = result_pair.second;
182983+
// Empty key means the path segment could not be parsed (including malformed
182984+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
182985+
// "no progress" as a recursive lookup of "".
182986+
if (key.empty()) {
182987+
return INVALID_JSON_POINTER;
182988+
}
182869182989
// Handle when its the case for wildcard
182870182990
if (key == "*") {
182871182991
// Loop through each field in the object
@@ -183231,7 +183351,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
183231183351

183232183352
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
183233183353
if (new_capacity > max_capacity()) { return CAPACITY; }
183234-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
183354+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
183235183355

183236183356
// string_capacity copied from document::allocate
183237183357
_capacity = 0;

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 21f79ce

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update simdjson to 4.6.6
PR-URL: #64942 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7a4960d commit 21f79ce

2 files changed

Lines changed: 139 additions & 19 deletions

File tree

β€Ždeps/simdjson/simdjson.cppβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.cpp: */
33
/* begin file simdjson.cpp */
44
#define SIMDJSON_SRC_SIMDJSON_CPP

β€Ždeps/simdjson/simdjson.hβ€Ž

Lines changed: 138 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.h: */
33
/* begin file simdjson.h */
44
#ifndef SIMDJSON_H
@@ -2538,7 +2538,7 @@ namespace std {
25382538
#define SIMDJSON_SIMDJSON_VERSION_H
25392539

25402540
/** The version of simdjson being used (major.minor.revision) */
2541-
#define SIMDJSON_VERSION "4.6.4"
2541+
#define SIMDJSON_VERSION "4.6.6"
25422542

25432543
namespace simdjson {
25442544
enum {
@@ -2553,7 +2553,7 @@ enum {
25532553
/**
25542554
* The revision (major.minor.REVISION) of simdjson being used.
25552555
*/
2556-
SIMDJSON_VERSION_REVISION = 4
2556+
SIMDJSON_VERSION_REVISION = 6
25572557
};
25582558
} // namespace simdjson
25592559

@@ -8067,16 +8067,28 @@ inline std::pair<std::string_view, std::string_view> get_next_key_and_json_path(
80678067
}
80688068

80698069
key = json_path.substr(key_start, i - key_start);
8070-
} else if ((i+1 < json_path.size()) && json_path[i] == '[' && (json_path[i+1] == '\'' || json_path[i+1] == '"')) {
8070+
} else if ((i + 1 < json_path.size()) && json_path[i] == '[' &&
8071+
(json_path[i + 1] == '\'' || json_path[i + 1] == '"')) {
8072+
// Bracket-quoted key: ['key'] or ["key"].
8073+
// Require a matching closing quote and a following ']'. If either is
8074+
// missing, return an empty key and the original path so callers can treat
8075+
// this as a parse failure (e.g. INVALID_JSON_POINTER) without advancing.
8076+
// Without this check, i += 2 can make i > size() and substr throws
8077+
// std::out_of_range, which aborts noexcept callers such as
8078+
// at_path_with_wildcard / for_each_at_path_with_wildcard.
8079+
const char quote = json_path[i + 1];
80718080
i += 2;
8072-
size_t key_start = i;
8073-
while (i < json_path.length() && json_path[i] != '\'' && json_path[i] != '"') {
8081+
const size_t key_start = i;
8082+
while (i < json_path.length() && json_path[i] != quote) {
80748083
++i;
80758084
}
8076-
8085+
if (i >= json_path.length() || // missing closing quote
8086+
i + 1 >= json_path.length() || // missing ]
8087+
json_path[i + 1] != ']') {
8088+
return {key, json_path};
8089+
}
80778090
key = json_path.substr(key_start, i - key_start);
8078-
8079-
i += 2;
8091+
i += 2; // past quote and ]
80808092
} else if ((i+2 < json_path.size()) && json_path[i] == '[' && json_path[i+1] == '*' && json_path[i+2] == ']') { // i.e [*].additional_keys or [*]["additional_keys"]
80818093
key = "*";
80828094
i += 3;
@@ -68653,6 +68665,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
6865368665
auto result_pair = get_next_key_and_json_path(json_path);
6865468666
std::string_view key = result_pair.first;
6865568667
std::string_view remaining_path = result_pair.second;
68668+
// Empty key means the path segment could not be parsed (including malformed
68669+
// bracket-quoted keys). Without this check, an empty key is treated as index
68670+
// 0 and remaining_path may be unchanged, causing infinite recursion.
68671+
if (key.empty()) {
68672+
return INVALID_JSON_POINTER;
68673+
}
6865668674
// Wildcard case
6865768675
if (key=="*"){
6865868676
for(auto element: *this) {
@@ -72182,6 +72200,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
7218272200
auto result_pair = get_next_key_and_json_path(json_path);
7218372201
std::string_view key = result_pair.first;
7218472202
std::string_view remaining_path = result_pair.second;
72203+
// Empty key means the path segment could not be parsed (including malformed
72204+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
72205+
// "no progress" as a recursive lookup of "".
72206+
if (key.empty()) {
72207+
return INVALID_JSON_POINTER;
72208+
}
7218572209
// Handle when its the case for wildcard
7218672210
if (key == "*") {
7218772211
// Loop through each field in the object
@@ -72547,7 +72571,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
7254772571

7254872572
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
7254972573
if (new_capacity > max_capacity()) { return CAPACITY; }
72550-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
72574+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
7255172575

7255272576
// string_capacity copied from document::allocate
7255372577
_capacity = 0;
@@ -82023,6 +82047,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
8202382047
auto result_pair = get_next_key_and_json_path(json_path);
8202482048
std::string_view key = result_pair.first;
8202582049
std::string_view remaining_path = result_pair.second;
82050+
// Empty key means the path segment could not be parsed (including malformed
82051+
// bracket-quoted keys). Without this check, an empty key is treated as index
82052+
// 0 and remaining_path may be unchanged, causing infinite recursion.
82053+
if (key.empty()) {
82054+
return INVALID_JSON_POINTER;
82055+
}
8202682056
// Wildcard case
8202782057
if (key=="*"){
8202882058
for(auto element: *this) {
@@ -85552,6 +85582,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
8555285582
auto result_pair = get_next_key_and_json_path(json_path);
8555385583
std::string_view key = result_pair.first;
8555485584
std::string_view remaining_path = result_pair.second;
85585+
// Empty key means the path segment could not be parsed (including malformed
85586+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
85587+
// "no progress" as a recursive lookup of "".
85588+
if (key.empty()) {
85589+
return INVALID_JSON_POINTER;
85590+
}
8555585591
// Handle when its the case for wildcard
8555685592
if (key == "*") {
8555785593
// Loop through each field in the object
@@ -85917,7 +85953,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
8591785953

8591885954
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
8591985955
if (new_capacity > max_capacity()) { return CAPACITY; }
85920-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
85956+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
8592185957

8592285958
// string_capacity copied from document::allocate
8592385959
_capacity = 0;
@@ -95880,6 +95916,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
9588095916
auto result_pair = get_next_key_and_json_path(json_path);
9588195917
std::string_view key = result_pair.first;
9588295918
std::string_view remaining_path = result_pair.second;
95919+
// Empty key means the path segment could not be parsed (including malformed
95920+
// bracket-quoted keys). Without this check, an empty key is treated as index
95921+
// 0 and remaining_path may be unchanged, causing infinite recursion.
95922+
if (key.empty()) {
95923+
return INVALID_JSON_POINTER;
95924+
}
9588395925
// Wildcard case
9588495926
if (key=="*"){
9588595927
for(auto element: *this) {
@@ -99409,6 +99451,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
9940999451
auto result_pair = get_next_key_and_json_path(json_path);
9941099452
std::string_view key = result_pair.first;
9941199453
std::string_view remaining_path = result_pair.second;
99454+
// Empty key means the path segment could not be parsed (including malformed
99455+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
99456+
// "no progress" as a recursive lookup of "".
99457+
if (key.empty()) {
99458+
return INVALID_JSON_POINTER;
99459+
}
9941299460
// Handle when its the case for wildcard
9941399461
if (key == "*") {
9941499462
// Loop through each field in the object
@@ -99774,7 +99822,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
9977499822

9977599823
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
9977699824
if (new_capacity > max_capacity()) { return CAPACITY; }
99777-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
99825+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
9977899826

9977999827
// string_capacity copied from document::allocate
9978099828
_capacity = 0;
@@ -109737,6 +109785,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
109737109785
auto result_pair = get_next_key_and_json_path(json_path);
109738109786
std::string_view key = result_pair.first;
109739109787
std::string_view remaining_path = result_pair.second;
109788+
// Empty key means the path segment could not be parsed (including malformed
109789+
// bracket-quoted keys). Without this check, an empty key is treated as index
109790+
// 0 and remaining_path may be unchanged, causing infinite recursion.
109791+
if (key.empty()) {
109792+
return INVALID_JSON_POINTER;
109793+
}
109740109794
// Wildcard case
109741109795
if (key=="*"){
109742109796
for(auto element: *this) {
@@ -113266,6 +113320,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
113266113320
auto result_pair = get_next_key_and_json_path(json_path);
113267113321
std::string_view key = result_pair.first;
113268113322
std::string_view remaining_path = result_pair.second;
113323+
// Empty key means the path segment could not be parsed (including malformed
113324+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
113325+
// "no progress" as a recursive lookup of "".
113326+
if (key.empty()) {
113327+
return INVALID_JSON_POINTER;
113328+
}
113269113329
// Handle when its the case for wildcard
113270113330
if (key == "*") {
113271113331
// Loop through each field in the object
@@ -113631,7 +113691,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
113631113691

113632113692
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
113633113693
if (new_capacity > max_capacity()) { return CAPACITY; }
113634-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
113694+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
113635113695

113636113696
// string_capacity copied from document::allocate
113637113697
_capacity = 0;
@@ -123709,6 +123769,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
123709123769
auto result_pair = get_next_key_and_json_path(json_path);
123710123770
std::string_view key = result_pair.first;
123711123771
std::string_view remaining_path = result_pair.second;
123772+
// Empty key means the path segment could not be parsed (including malformed
123773+
// bracket-quoted keys). Without this check, an empty key is treated as index
123774+
// 0 and remaining_path may be unchanged, causing infinite recursion.
123775+
if (key.empty()) {
123776+
return INVALID_JSON_POINTER;
123777+
}
123712123778
// Wildcard case
123713123779
if (key=="*"){
123714123780
for(auto element: *this) {
@@ -127238,6 +127304,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
127238127304
auto result_pair = get_next_key_and_json_path(json_path);
127239127305
std::string_view key = result_pair.first;
127240127306
std::string_view remaining_path = result_pair.second;
127307+
// Empty key means the path segment could not be parsed (including malformed
127308+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
127309+
// "no progress" as a recursive lookup of "".
127310+
if (key.empty()) {
127311+
return INVALID_JSON_POINTER;
127312+
}
127241127313
// Handle when its the case for wildcard
127242127314
if (key == "*") {
127243127315
// Loop through each field in the object
@@ -127603,7 +127675,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
127603127675

127604127676
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
127605127677
if (new_capacity > max_capacity()) { return CAPACITY; }
127606-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
127678+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
127607127679

127608127680
// string_capacity copied from document::allocate
127609127681
_capacity = 0;
@@ -137998,6 +138070,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
137998138070
auto result_pair = get_next_key_and_json_path(json_path);
137999138071
std::string_view key = result_pair.first;
138000138072
std::string_view remaining_path = result_pair.second;
138073+
// Empty key means the path segment could not be parsed (including malformed
138074+
// bracket-quoted keys). Without this check, an empty key is treated as index
138075+
// 0 and remaining_path may be unchanged, causing infinite recursion.
138076+
if (key.empty()) {
138077+
return INVALID_JSON_POINTER;
138078+
}
138001138079
// Wildcard case
138002138080
if (key=="*"){
138003138081
for(auto element: *this) {
@@ -141527,6 +141605,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
141527141605
auto result_pair = get_next_key_and_json_path(json_path);
141528141606
std::string_view key = result_pair.first;
141529141607
std::string_view remaining_path = result_pair.second;
141608+
// Empty key means the path segment could not be parsed (including malformed
141609+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
141610+
// "no progress" as a recursive lookup of "".
141611+
if (key.empty()) {
141612+
return INVALID_JSON_POINTER;
141613+
}
141530141614
// Handle when its the case for wildcard
141531141615
if (key == "*") {
141532141616
// Loop through each field in the object
@@ -141892,7 +141976,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
141892141976

141893141977
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
141894141978
if (new_capacity > max_capacity()) { return CAPACITY; }
141895-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
141979+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
141896141980

141897141981
// string_capacity copied from document::allocate
141898141982
_capacity = 0;
@@ -151761,6 +151845,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
151761151845
auto result_pair = get_next_key_and_json_path(json_path);
151762151846
std::string_view key = result_pair.first;
151763151847
std::string_view remaining_path = result_pair.second;
151848+
// Empty key means the path segment could not be parsed (including malformed
151849+
// bracket-quoted keys). Without this check, an empty key is treated as index
151850+
// 0 and remaining_path may be unchanged, causing infinite recursion.
151851+
if (key.empty()) {
151852+
return INVALID_JSON_POINTER;
151853+
}
151764151854
// Wildcard case
151765151855
if (key=="*"){
151766151856
for(auto element: *this) {
@@ -155290,6 +155380,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
155290155380
auto result_pair = get_next_key_and_json_path(json_path);
155291155381
std::string_view key = result_pair.first;
155292155382
std::string_view remaining_path = result_pair.second;
155383+
// Empty key means the path segment could not be parsed (including malformed
155384+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
155385+
// "no progress" as a recursive lookup of "".
155386+
if (key.empty()) {
155387+
return INVALID_JSON_POINTER;
155388+
}
155293155389
// Handle when its the case for wildcard
155294155390
if (key == "*") {
155295155391
// Loop through each field in the object
@@ -155655,7 +155751,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
155655155751

155656155752
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
155657155753
if (new_capacity > max_capacity()) { return CAPACITY; }
155658-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
155754+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
155659155755

155660155756
// string_capacity copied from document::allocate
155661155757
_capacity = 0;
@@ -165547,6 +165643,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
165547165643
auto result_pair = get_next_key_and_json_path(json_path);
165548165644
std::string_view key = result_pair.first;
165549165645
std::string_view remaining_path = result_pair.second;
165646+
// Empty key means the path segment could not be parsed (including malformed
165647+
// bracket-quoted keys). Without this check, an empty key is treated as index
165648+
// 0 and remaining_path may be unchanged, causing infinite recursion.
165649+
if (key.empty()) {
165650+
return INVALID_JSON_POINTER;
165651+
}
165550165652
// Wildcard case
165551165653
if (key=="*"){
165552165654
for(auto element: *this) {
@@ -169076,6 +169178,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
169076169178
auto result_pair = get_next_key_and_json_path(json_path);
169077169179
std::string_view key = result_pair.first;
169078169180
std::string_view remaining_path = result_pair.second;
169181+
// Empty key means the path segment could not be parsed (including malformed
169182+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
169183+
// "no progress" as a recursive lookup of "".
169184+
if (key.empty()) {
169185+
return INVALID_JSON_POINTER;
169186+
}
169079169187
// Handle when its the case for wildcard
169080169188
if (key == "*") {
169081169189
// Loop through each field in the object
@@ -169441,7 +169549,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
169441169549

169442169550
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
169443169551
if (new_capacity > max_capacity()) { return CAPACITY; }
169444-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
169552+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
169445169553

169446169554
// string_capacity copied from document::allocate
169447169555
_capacity = 0;
@@ -179337,6 +179445,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
179337179445
auto result_pair = get_next_key_and_json_path(json_path);
179338179446
std::string_view key = result_pair.first;
179339179447
std::string_view remaining_path = result_pair.second;
179448+
// Empty key means the path segment could not be parsed (including malformed
179449+
// bracket-quoted keys). Without this check, an empty key is treated as index
179450+
// 0 and remaining_path may be unchanged, causing infinite recursion.
179451+
if (key.empty()) {
179452+
return INVALID_JSON_POINTER;
179453+
}
179340179454
// Wildcard case
179341179455
if (key=="*"){
179342179456
for(auto element: *this) {
@@ -182866,6 +182980,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
182866182980
auto result_pair = get_next_key_and_json_path(json_path);
182867182981
std::string_view key = result_pair.first;
182868182982
std::string_view remaining_path = result_pair.second;
182983+
// Empty key means the path segment could not be parsed (including malformed
182984+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
182985+
// "no progress" as a recursive lookup of "".
182986+
if (key.empty()) {
182987+
return INVALID_JSON_POINTER;
182988+
}
182869182989
// Handle when its the case for wildcard
182870182990
if (key == "*") {
182871182991
// Loop through each field in the object
@@ -183231,7 +183351,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
183231183351

183232183352
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
183233183353
if (new_capacity > max_capacity()) { return CAPACITY; }
183234-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
183354+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
183235183355

183236183356
// string_capacity copied from document::allocate
183237183357
_capacity = 0;

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 21f79ce

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update simdjson to 4.6.6
PR-URL: #64942 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7a4960d commit 21f79ce

2 files changed

Lines changed: 139 additions & 19 deletions

File tree

β€Ždeps/simdjson/simdjson.cppβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.cpp: */
33
/* begin file simdjson.cpp */
44
#define SIMDJSON_SRC_SIMDJSON_CPP

β€Ždeps/simdjson/simdjson.hβ€Ž

Lines changed: 138 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.h: */
33
/* begin file simdjson.h */
44
#ifndef SIMDJSON_H
@@ -2538,7 +2538,7 @@ namespace std {
25382538
#define SIMDJSON_SIMDJSON_VERSION_H
25392539

25402540
/** The version of simdjson being used (major.minor.revision) */
2541-
#define SIMDJSON_VERSION "4.6.4"
2541+
#define SIMDJSON_VERSION "4.6.6"
25422542

25432543
namespace simdjson {
25442544
enum {
@@ -2553,7 +2553,7 @@ enum {
25532553
/**
25542554
* The revision (major.minor.REVISION) of simdjson being used.
25552555
*/
2556-
SIMDJSON_VERSION_REVISION = 4
2556+
SIMDJSON_VERSION_REVISION = 6
25572557
};
25582558
} // namespace simdjson
25592559

@@ -8067,16 +8067,28 @@ inline std::pair<std::string_view, std::string_view> get_next_key_and_json_path(
80678067
}
80688068

80698069
key = json_path.substr(key_start, i - key_start);
8070-
} else if ((i+1 < json_path.size()) && json_path[i] == '[' && (json_path[i+1] == '\'' || json_path[i+1] == '"')) {
8070+
} else if ((i + 1 < json_path.size()) && json_path[i] == '[' &&
8071+
(json_path[i + 1] == '\'' || json_path[i + 1] == '"')) {
8072+
// Bracket-quoted key: ['key'] or ["key"].
8073+
// Require a matching closing quote and a following ']'. If either is
8074+
// missing, return an empty key and the original path so callers can treat
8075+
// this as a parse failure (e.g. INVALID_JSON_POINTER) without advancing.
8076+
// Without this check, i += 2 can make i > size() and substr throws
8077+
// std::out_of_range, which aborts noexcept callers such as
8078+
// at_path_with_wildcard / for_each_at_path_with_wildcard.
8079+
const char quote = json_path[i + 1];
80718080
i += 2;
8072-
size_t key_start = i;
8073-
while (i < json_path.length() && json_path[i] != '\'' && json_path[i] != '"') {
8081+
const size_t key_start = i;
8082+
while (i < json_path.length() && json_path[i] != quote) {
80748083
++i;
80758084
}
8076-
8085+
if (i >= json_path.length() || // missing closing quote
8086+
i + 1 >= json_path.length() || // missing ]
8087+
json_path[i + 1] != ']') {
8088+
return {key, json_path};
8089+
}
80778090
key = json_path.substr(key_start, i - key_start);
8078-
8079-
i += 2;
8091+
i += 2; // past quote and ]
80808092
} else if ((i+2 < json_path.size()) && json_path[i] == '[' && json_path[i+1] == '*' && json_path[i+2] == ']') { // i.e [*].additional_keys or [*]["additional_keys"]
80818093
key = "*";
80828094
i += 3;
@@ -68653,6 +68665,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
6865368665
auto result_pair = get_next_key_and_json_path(json_path);
6865468666
std::string_view key = result_pair.first;
6865568667
std::string_view remaining_path = result_pair.second;
68668+
// Empty key means the path segment could not be parsed (including malformed
68669+
// bracket-quoted keys). Without this check, an empty key is treated as index
68670+
// 0 and remaining_path may be unchanged, causing infinite recursion.
68671+
if (key.empty()) {
68672+
return INVALID_JSON_POINTER;
68673+
}
6865668674
// Wildcard case
6865768675
if (key=="*"){
6865868676
for(auto element: *this) {
@@ -72182,6 +72200,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
7218272200
auto result_pair = get_next_key_and_json_path(json_path);
7218372201
std::string_view key = result_pair.first;
7218472202
std::string_view remaining_path = result_pair.second;
72203+
// Empty key means the path segment could not be parsed (including malformed
72204+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
72205+
// "no progress" as a recursive lookup of "".
72206+
if (key.empty()) {
72207+
return INVALID_JSON_POINTER;
72208+
}
7218572209
// Handle when its the case for wildcard
7218672210
if (key == "*") {
7218772211
// Loop through each field in the object
@@ -72547,7 +72571,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
7254772571

7254872572
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
7254972573
if (new_capacity > max_capacity()) { return CAPACITY; }
72550-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
72574+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
7255172575

7255272576
// string_capacity copied from document::allocate
7255372577
_capacity = 0;
@@ -82023,6 +82047,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
8202382047
auto result_pair = get_next_key_and_json_path(json_path);
8202482048
std::string_view key = result_pair.first;
8202582049
std::string_view remaining_path = result_pair.second;
82050+
// Empty key means the path segment could not be parsed (including malformed
82051+
// bracket-quoted keys). Without this check, an empty key is treated as index
82052+
// 0 and remaining_path may be unchanged, causing infinite recursion.
82053+
if (key.empty()) {
82054+
return INVALID_JSON_POINTER;
82055+
}
8202682056
// Wildcard case
8202782057
if (key=="*"){
8202882058
for(auto element: *this) {
@@ -85552,6 +85582,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
8555285582
auto result_pair = get_next_key_and_json_path(json_path);
8555385583
std::string_view key = result_pair.first;
8555485584
std::string_view remaining_path = result_pair.second;
85585+
// Empty key means the path segment could not be parsed (including malformed
85586+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
85587+
// "no progress" as a recursive lookup of "".
85588+
if (key.empty()) {
85589+
return INVALID_JSON_POINTER;
85590+
}
8555585591
// Handle when its the case for wildcard
8555685592
if (key == "*") {
8555785593
// Loop through each field in the object
@@ -85917,7 +85953,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
8591785953

8591885954
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
8591985955
if (new_capacity > max_capacity()) { return CAPACITY; }
85920-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
85956+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
8592185957

8592285958
// string_capacity copied from document::allocate
8592385959
_capacity = 0;
@@ -95880,6 +95916,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
9588095916
auto result_pair = get_next_key_and_json_path(json_path);
9588195917
std::string_view key = result_pair.first;
9588295918
std::string_view remaining_path = result_pair.second;
95919+
// Empty key means the path segment could not be parsed (including malformed
95920+
// bracket-quoted keys). Without this check, an empty key is treated as index
95921+
// 0 and remaining_path may be unchanged, causing infinite recursion.
95922+
if (key.empty()) {
95923+
return INVALID_JSON_POINTER;
95924+
}
9588395925
// Wildcard case
9588495926
if (key=="*"){
9588595927
for(auto element: *this) {
@@ -99409,6 +99451,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
9940999451
auto result_pair = get_next_key_and_json_path(json_path);
9941099452
std::string_view key = result_pair.first;
9941199453
std::string_view remaining_path = result_pair.second;
99454+
// Empty key means the path segment could not be parsed (including malformed
99455+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
99456+
// "no progress" as a recursive lookup of "".
99457+
if (key.empty()) {
99458+
return INVALID_JSON_POINTER;
99459+
}
9941299460
// Handle when its the case for wildcard
9941399461
if (key == "*") {
9941499462
// Loop through each field in the object
@@ -99774,7 +99822,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
9977499822

9977599823
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
9977699824
if (new_capacity > max_capacity()) { return CAPACITY; }
99777-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
99825+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
9977899826

9977999827
// string_capacity copied from document::allocate
9978099828
_capacity = 0;
@@ -109737,6 +109785,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
109737109785
auto result_pair = get_next_key_and_json_path(json_path);
109738109786
std::string_view key = result_pair.first;
109739109787
std::string_view remaining_path = result_pair.second;
109788+
// Empty key means the path segment could not be parsed (including malformed
109789+
// bracket-quoted keys). Without this check, an empty key is treated as index
109790+
// 0 and remaining_path may be unchanged, causing infinite recursion.
109791+
if (key.empty()) {
109792+
return INVALID_JSON_POINTER;
109793+
}
109740109794
// Wildcard case
109741109795
if (key=="*"){
109742109796
for(auto element: *this) {
@@ -113266,6 +113320,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
113266113320
auto result_pair = get_next_key_and_json_path(json_path);
113267113321
std::string_view key = result_pair.first;
113268113322
std::string_view remaining_path = result_pair.second;
113323+
// Empty key means the path segment could not be parsed (including malformed
113324+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
113325+
// "no progress" as a recursive lookup of "".
113326+
if (key.empty()) {
113327+
return INVALID_JSON_POINTER;
113328+
}
113269113329
// Handle when its the case for wildcard
113270113330
if (key == "*") {
113271113331
// Loop through each field in the object
@@ -113631,7 +113691,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
113631113691

113632113692
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
113633113693
if (new_capacity > max_capacity()) { return CAPACITY; }
113634-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
113694+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
113635113695

113636113696
// string_capacity copied from document::allocate
113637113697
_capacity = 0;
@@ -123709,6 +123769,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
123709123769
auto result_pair = get_next_key_and_json_path(json_path);
123710123770
std::string_view key = result_pair.first;
123711123771
std::string_view remaining_path = result_pair.second;
123772+
// Empty key means the path segment could not be parsed (including malformed
123773+
// bracket-quoted keys). Without this check, an empty key is treated as index
123774+
// 0 and remaining_path may be unchanged, causing infinite recursion.
123775+
if (key.empty()) {
123776+
return INVALID_JSON_POINTER;
123777+
}
123712123778
// Wildcard case
123713123779
if (key=="*"){
123714123780
for(auto element: *this) {
@@ -127238,6 +127304,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
127238127304
auto result_pair = get_next_key_and_json_path(json_path);
127239127305
std::string_view key = result_pair.first;
127240127306
std::string_view remaining_path = result_pair.second;
127307+
// Empty key means the path segment could not be parsed (including malformed
127308+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
127309+
// "no progress" as a recursive lookup of "".
127310+
if (key.empty()) {
127311+
return INVALID_JSON_POINTER;
127312+
}
127241127313
// Handle when its the case for wildcard
127242127314
if (key == "*") {
127243127315
// Loop through each field in the object
@@ -127603,7 +127675,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
127603127675

127604127676
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
127605127677
if (new_capacity > max_capacity()) { return CAPACITY; }
127606-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
127678+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
127607127679

127608127680
// string_capacity copied from document::allocate
127609127681
_capacity = 0;
@@ -137998,6 +138070,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
137998138070
auto result_pair = get_next_key_and_json_path(json_path);
137999138071
std::string_view key = result_pair.first;
138000138072
std::string_view remaining_path = result_pair.second;
138073+
// Empty key means the path segment could not be parsed (including malformed
138074+
// bracket-quoted keys). Without this check, an empty key is treated as index
138075+
// 0 and remaining_path may be unchanged, causing infinite recursion.
138076+
if (key.empty()) {
138077+
return INVALID_JSON_POINTER;
138078+
}
138001138079
// Wildcard case
138002138080
if (key=="*"){
138003138081
for(auto element: *this) {
@@ -141527,6 +141605,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
141527141605
auto result_pair = get_next_key_and_json_path(json_path);
141528141606
std::string_view key = result_pair.first;
141529141607
std::string_view remaining_path = result_pair.second;
141608+
// Empty key means the path segment could not be parsed (including malformed
141609+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
141610+
// "no progress" as a recursive lookup of "".
141611+
if (key.empty()) {
141612+
return INVALID_JSON_POINTER;
141613+
}
141530141614
// Handle when its the case for wildcard
141531141615
if (key == "*") {
141532141616
// Loop through each field in the object
@@ -141892,7 +141976,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
141892141976

141893141977
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
141894141978
if (new_capacity > max_capacity()) { return CAPACITY; }
141895-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
141979+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
141896141980

141897141981
// string_capacity copied from document::allocate
141898141982
_capacity = 0;
@@ -151761,6 +151845,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
151761151845
auto result_pair = get_next_key_and_json_path(json_path);
151762151846
std::string_view key = result_pair.first;
151763151847
std::string_view remaining_path = result_pair.second;
151848+
// Empty key means the path segment could not be parsed (including malformed
151849+
// bracket-quoted keys). Without this check, an empty key is treated as index
151850+
// 0 and remaining_path may be unchanged, causing infinite recursion.
151851+
if (key.empty()) {
151852+
return INVALID_JSON_POINTER;
151853+
}
151764151854
// Wildcard case
151765151855
if (key=="*"){
151766151856
for(auto element: *this) {
@@ -155290,6 +155380,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
155290155380
auto result_pair = get_next_key_and_json_path(json_path);
155291155381
std::string_view key = result_pair.first;
155292155382
std::string_view remaining_path = result_pair.second;
155383+
// Empty key means the path segment could not be parsed (including malformed
155384+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
155385+
// "no progress" as a recursive lookup of "".
155386+
if (key.empty()) {
155387+
return INVALID_JSON_POINTER;
155388+
}
155293155389
// Handle when its the case for wildcard
155294155390
if (key == "*") {
155295155391
// Loop through each field in the object
@@ -155655,7 +155751,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
155655155751

155656155752
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
155657155753
if (new_capacity > max_capacity()) { return CAPACITY; }
155658-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
155754+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
155659155755

155660155756
// string_capacity copied from document::allocate
155661155757
_capacity = 0;
@@ -165547,6 +165643,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
165547165643
auto result_pair = get_next_key_and_json_path(json_path);
165548165644
std::string_view key = result_pair.first;
165549165645
std::string_view remaining_path = result_pair.second;
165646+
// Empty key means the path segment could not be parsed (including malformed
165647+
// bracket-quoted keys). Without this check, an empty key is treated as index
165648+
// 0 and remaining_path may be unchanged, causing infinite recursion.
165649+
if (key.empty()) {
165650+
return INVALID_JSON_POINTER;
165651+
}
165550165652
// Wildcard case
165551165653
if (key=="*"){
165552165654
for(auto element: *this) {
@@ -169076,6 +169178,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
169076169178
auto result_pair = get_next_key_and_json_path(json_path);
169077169179
std::string_view key = result_pair.first;
169078169180
std::string_view remaining_path = result_pair.second;
169181+
// Empty key means the path segment could not be parsed (including malformed
169182+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
169183+
// "no progress" as a recursive lookup of "".
169184+
if (key.empty()) {
169185+
return INVALID_JSON_POINTER;
169186+
}
169079169187
// Handle when its the case for wildcard
169080169188
if (key == "*") {
169081169189
// Loop through each field in the object
@@ -169441,7 +169549,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
169441169549

169442169550
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
169443169551
if (new_capacity > max_capacity()) { return CAPACITY; }
169444-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
169552+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
169445169553

169446169554
// string_capacity copied from document::allocate
169447169555
_capacity = 0;
@@ -179337,6 +179445,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
179337179445
auto result_pair = get_next_key_and_json_path(json_path);
179338179446
std::string_view key = result_pair.first;
179339179447
std::string_view remaining_path = result_pair.second;
179448+
// Empty key means the path segment could not be parsed (including malformed
179449+
// bracket-quoted keys). Without this check, an empty key is treated as index
179450+
// 0 and remaining_path may be unchanged, causing infinite recursion.
179451+
if (key.empty()) {
179452+
return INVALID_JSON_POINTER;
179453+
}
179340179454
// Wildcard case
179341179455
if (key=="*"){
179342179456
for(auto element: *this) {
@@ -182866,6 +182980,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
182866182980
auto result_pair = get_next_key_and_json_path(json_path);
182867182981
std::string_view key = result_pair.first;
182868182982
std::string_view remaining_path = result_pair.second;
182983+
// Empty key means the path segment could not be parsed (including malformed
182984+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
182985+
// "no progress" as a recursive lookup of "".
182986+
if (key.empty()) {
182987+
return INVALID_JSON_POINTER;
182988+
}
182869182989
// Handle when its the case for wildcard
182870182990
if (key == "*") {
182871182991
// Loop through each field in the object
@@ -183231,7 +183351,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
183231183351

183232183352
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
183233183353
if (new_capacity > max_capacity()) { return CAPACITY; }
183234-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
183354+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
183235183355

183236183356
// string_capacity copied from document::allocate
183237183357
_capacity = 0;

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Commit 21f79ce

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update simdjson to 4.6.6
PR-URL: #64942 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7a4960d commit 21f79ce

2 files changed

Lines changed: 139 additions & 19 deletions

File tree

β€Ždeps/simdjson/simdjson.cppβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.cpp: */
33
/* begin file simdjson.cpp */
44
#define SIMDJSON_SRC_SIMDJSON_CPP

β€Ždeps/simdjson/simdjson.hβ€Ž

Lines changed: 138 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.h: */
33
/* begin file simdjson.h */
44
#ifndef SIMDJSON_H
@@ -2538,7 +2538,7 @@ namespace std {
25382538
#define SIMDJSON_SIMDJSON_VERSION_H
25392539

25402540
/** The version of simdjson being used (major.minor.revision) */
2541-
#define SIMDJSON_VERSION "4.6.4"
2541+
#define SIMDJSON_VERSION "4.6.6"
25422542

25432543
namespace simdjson {
25442544
enum {
@@ -2553,7 +2553,7 @@ enum {
25532553
/**
25542554
* The revision (major.minor.REVISION) of simdjson being used.
25552555
*/
2556-
SIMDJSON_VERSION_REVISION = 4
2556+
SIMDJSON_VERSION_REVISION = 6
25572557
};
25582558
} // namespace simdjson
25592559

@@ -8067,16 +8067,28 @@ inline std::pair<std::string_view, std::string_view> get_next_key_and_json_path(
80678067
}
80688068

80698069
key = json_path.substr(key_start, i - key_start);
8070-
} else if ((i+1 < json_path.size()) && json_path[i] == '[' && (json_path[i+1] == '\'' || json_path[i+1] == '"')) {
8070+
} else if ((i + 1 < json_path.size()) && json_path[i] == '[' &&
8071+
(json_path[i + 1] == '\'' || json_path[i + 1] == '"')) {
8072+
// Bracket-quoted key: ['key'] or ["key"].
8073+
// Require a matching closing quote and a following ']'. If either is
8074+
// missing, return an empty key and the original path so callers can treat
8075+
// this as a parse failure (e.g. INVALID_JSON_POINTER) without advancing.
8076+
// Without this check, i += 2 can make i > size() and substr throws
8077+
// std::out_of_range, which aborts noexcept callers such as
8078+
// at_path_with_wildcard / for_each_at_path_with_wildcard.
8079+
const char quote = json_path[i + 1];
80718080
i += 2;
8072-
size_t key_start = i;
8073-
while (i < json_path.length() && json_path[i] != '\'' && json_path[i] != '"') {
8081+
const size_t key_start = i;
8082+
while (i < json_path.length() && json_path[i] != quote) {
80748083
++i;
80758084
}
8076-
8085+
if (i >= json_path.length() || // missing closing quote
8086+
i + 1 >= json_path.length() || // missing ]
8087+
json_path[i + 1] != ']') {
8088+
return {key, json_path};
8089+
}
80778090
key = json_path.substr(key_start, i - key_start);
8078-
8079-
i += 2;
8091+
i += 2; // past quote and ]
80808092
} else if ((i+2 < json_path.size()) && json_path[i] == '[' && json_path[i+1] == '*' && json_path[i+2] == ']') { // i.e [*].additional_keys or [*]["additional_keys"]
80818093
key = "*";
80828094
i += 3;
@@ -68653,6 +68665,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
6865368665
auto result_pair = get_next_key_and_json_path(json_path);
6865468666
std::string_view key = result_pair.first;
6865568667
std::string_view remaining_path = result_pair.second;
68668+
// Empty key means the path segment could not be parsed (including malformed
68669+
// bracket-quoted keys). Without this check, an empty key is treated as index
68670+
// 0 and remaining_path may be unchanged, causing infinite recursion.
68671+
if (key.empty()) {
68672+
return INVALID_JSON_POINTER;
68673+
}
6865668674
// Wildcard case
6865768675
if (key=="*"){
6865868676
for(auto element: *this) {
@@ -72182,6 +72200,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
7218272200
auto result_pair = get_next_key_and_json_path(json_path);
7218372201
std::string_view key = result_pair.first;
7218472202
std::string_view remaining_path = result_pair.second;
72203+
// Empty key means the path segment could not be parsed (including malformed
72204+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
72205+
// "no progress" as a recursive lookup of "".
72206+
if (key.empty()) {
72207+
return INVALID_JSON_POINTER;
72208+
}
7218572209
// Handle when its the case for wildcard
7218672210
if (key == "*") {
7218772211
// Loop through each field in the object
@@ -72547,7 +72571,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
7254772571

7254872572
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
7254972573
if (new_capacity > max_capacity()) { return CAPACITY; }
72550-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
72574+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
7255172575

7255272576
// string_capacity copied from document::allocate
7255372577
_capacity = 0;
@@ -82023,6 +82047,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
8202382047
auto result_pair = get_next_key_and_json_path(json_path);
8202482048
std::string_view key = result_pair.first;
8202582049
std::string_view remaining_path = result_pair.second;
82050+
// Empty key means the path segment could not be parsed (including malformed
82051+
// bracket-quoted keys). Without this check, an empty key is treated as index
82052+
// 0 and remaining_path may be unchanged, causing infinite recursion.
82053+
if (key.empty()) {
82054+
return INVALID_JSON_POINTER;
82055+
}
8202682056
// Wildcard case
8202782057
if (key=="*"){
8202882058
for(auto element: *this) {
@@ -85552,6 +85582,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
8555285582
auto result_pair = get_next_key_and_json_path(json_path);
8555385583
std::string_view key = result_pair.first;
8555485584
std::string_view remaining_path = result_pair.second;
85585+
// Empty key means the path segment could not be parsed (including malformed
85586+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
85587+
// "no progress" as a recursive lookup of "".
85588+
if (key.empty()) {
85589+
return INVALID_JSON_POINTER;
85590+
}
8555585591
// Handle when its the case for wildcard
8555685592
if (key == "*") {
8555785593
// Loop through each field in the object
@@ -85917,7 +85953,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
8591785953

8591885954
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
8591985955
if (new_capacity > max_capacity()) { return CAPACITY; }
85920-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
85956+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
8592185957

8592285958
// string_capacity copied from document::allocate
8592385959
_capacity = 0;
@@ -95880,6 +95916,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
9588095916
auto result_pair = get_next_key_and_json_path(json_path);
9588195917
std::string_view key = result_pair.first;
9588295918
std::string_view remaining_path = result_pair.second;
95919+
// Empty key means the path segment could not be parsed (including malformed
95920+
// bracket-quoted keys). Without this check, an empty key is treated as index
95921+
// 0 and remaining_path may be unchanged, causing infinite recursion.
95922+
if (key.empty()) {
95923+
return INVALID_JSON_POINTER;
95924+
}
9588395925
// Wildcard case
9588495926
if (key=="*"){
9588595927
for(auto element: *this) {
@@ -99409,6 +99451,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
9940999451
auto result_pair = get_next_key_and_json_path(json_path);
9941099452
std::string_view key = result_pair.first;
9941199453
std::string_view remaining_path = result_pair.second;
99454+
// Empty key means the path segment could not be parsed (including malformed
99455+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
99456+
// "no progress" as a recursive lookup of "".
99457+
if (key.empty()) {
99458+
return INVALID_JSON_POINTER;
99459+
}
9941299460
// Handle when its the case for wildcard
9941399461
if (key == "*") {
9941499462
// Loop through each field in the object
@@ -99774,7 +99822,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
9977499822

9977599823
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
9977699824
if (new_capacity > max_capacity()) { return CAPACITY; }
99777-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
99825+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
9977899826

9977999827
// string_capacity copied from document::allocate
9978099828
_capacity = 0;
@@ -109737,6 +109785,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
109737109785
auto result_pair = get_next_key_and_json_path(json_path);
109738109786
std::string_view key = result_pair.first;
109739109787
std::string_view remaining_path = result_pair.second;
109788+
// Empty key means the path segment could not be parsed (including malformed
109789+
// bracket-quoted keys). Without this check, an empty key is treated as index
109790+
// 0 and remaining_path may be unchanged, causing infinite recursion.
109791+
if (key.empty()) {
109792+
return INVALID_JSON_POINTER;
109793+
}
109740109794
// Wildcard case
109741109795
if (key=="*"){
109742109796
for(auto element: *this) {
@@ -113266,6 +113320,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
113266113320
auto result_pair = get_next_key_and_json_path(json_path);
113267113321
std::string_view key = result_pair.first;
113268113322
std::string_view remaining_path = result_pair.second;
113323+
// Empty key means the path segment could not be parsed (including malformed
113324+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
113325+
// "no progress" as a recursive lookup of "".
113326+
if (key.empty()) {
113327+
return INVALID_JSON_POINTER;
113328+
}
113269113329
// Handle when its the case for wildcard
113270113330
if (key == "*") {
113271113331
// Loop through each field in the object
@@ -113631,7 +113691,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
113631113691

113632113692
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
113633113693
if (new_capacity > max_capacity()) { return CAPACITY; }
113634-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
113694+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
113635113695

113636113696
// string_capacity copied from document::allocate
113637113697
_capacity = 0;
@@ -123709,6 +123769,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
123709123769
auto result_pair = get_next_key_and_json_path(json_path);
123710123770
std::string_view key = result_pair.first;
123711123771
std::string_view remaining_path = result_pair.second;
123772+
// Empty key means the path segment could not be parsed (including malformed
123773+
// bracket-quoted keys). Without this check, an empty key is treated as index
123774+
// 0 and remaining_path may be unchanged, causing infinite recursion.
123775+
if (key.empty()) {
123776+
return INVALID_JSON_POINTER;
123777+
}
123712123778
// Wildcard case
123713123779
if (key=="*"){
123714123780
for(auto element: *this) {
@@ -127238,6 +127304,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
127238127304
auto result_pair = get_next_key_and_json_path(json_path);
127239127305
std::string_view key = result_pair.first;
127240127306
std::string_view remaining_path = result_pair.second;
127307+
// Empty key means the path segment could not be parsed (including malformed
127308+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
127309+
// "no progress" as a recursive lookup of "".
127310+
if (key.empty()) {
127311+
return INVALID_JSON_POINTER;
127312+
}
127241127313
// Handle when its the case for wildcard
127242127314
if (key == "*") {
127243127315
// Loop through each field in the object
@@ -127603,7 +127675,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
127603127675

127604127676
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
127605127677
if (new_capacity > max_capacity()) { return CAPACITY; }
127606-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
127678+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
127607127679

127608127680
// string_capacity copied from document::allocate
127609127681
_capacity = 0;
@@ -137998,6 +138070,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
137998138070
auto result_pair = get_next_key_and_json_path(json_path);
137999138071
std::string_view key = result_pair.first;
138000138072
std::string_view remaining_path = result_pair.second;
138073+
// Empty key means the path segment could not be parsed (including malformed
138074+
// bracket-quoted keys). Without this check, an empty key is treated as index
138075+
// 0 and remaining_path may be unchanged, causing infinite recursion.
138076+
if (key.empty()) {
138077+
return INVALID_JSON_POINTER;
138078+
}
138001138079
// Wildcard case
138002138080
if (key=="*"){
138003138081
for(auto element: *this) {
@@ -141527,6 +141605,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
141527141605
auto result_pair = get_next_key_and_json_path(json_path);
141528141606
std::string_view key = result_pair.first;
141529141607
std::string_view remaining_path = result_pair.second;
141608+
// Empty key means the path segment could not be parsed (including malformed
141609+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
141610+
// "no progress" as a recursive lookup of "".
141611+
if (key.empty()) {
141612+
return INVALID_JSON_POINTER;
141613+
}
141530141614
// Handle when its the case for wildcard
141531141615
if (key == "*") {
141532141616
// Loop through each field in the object
@@ -141892,7 +141976,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
141892141976

141893141977
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
141894141978
if (new_capacity > max_capacity()) { return CAPACITY; }
141895-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
141979+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
141896141980

141897141981
// string_capacity copied from document::allocate
141898141982
_capacity = 0;
@@ -151761,6 +151845,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
151761151845
auto result_pair = get_next_key_and_json_path(json_path);
151762151846
std::string_view key = result_pair.first;
151763151847
std::string_view remaining_path = result_pair.second;
151848+
// Empty key means the path segment could not be parsed (including malformed
151849+
// bracket-quoted keys). Without this check, an empty key is treated as index
151850+
// 0 and remaining_path may be unchanged, causing infinite recursion.
151851+
if (key.empty()) {
151852+
return INVALID_JSON_POINTER;
151853+
}
151764151854
// Wildcard case
151765151855
if (key=="*"){
151766151856
for(auto element: *this) {
@@ -155290,6 +155380,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
155290155380
auto result_pair = get_next_key_and_json_path(json_path);
155291155381
std::string_view key = result_pair.first;
155292155382
std::string_view remaining_path = result_pair.second;
155383+
// Empty key means the path segment could not be parsed (including malformed
155384+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
155385+
// "no progress" as a recursive lookup of "".
155386+
if (key.empty()) {
155387+
return INVALID_JSON_POINTER;
155388+
}
155293155389
// Handle when its the case for wildcard
155294155390
if (key == "*") {
155295155391
// Loop through each field in the object
@@ -155655,7 +155751,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
155655155751

155656155752
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
155657155753
if (new_capacity > max_capacity()) { return CAPACITY; }
155658-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
155754+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
155659155755

155660155756
// string_capacity copied from document::allocate
155661155757
_capacity = 0;
@@ -165547,6 +165643,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
165547165643
auto result_pair = get_next_key_and_json_path(json_path);
165548165644
std::string_view key = result_pair.first;
165549165645
std::string_view remaining_path = result_pair.second;
165646+
// Empty key means the path segment could not be parsed (including malformed
165647+
// bracket-quoted keys). Without this check, an empty key is treated as index
165648+
// 0 and remaining_path may be unchanged, causing infinite recursion.
165649+
if (key.empty()) {
165650+
return INVALID_JSON_POINTER;
165651+
}
165550165652
// Wildcard case
165551165653
if (key=="*"){
165552165654
for(auto element: *this) {
@@ -169076,6 +169178,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
169076169178
auto result_pair = get_next_key_and_json_path(json_path);
169077169179
std::string_view key = result_pair.first;
169078169180
std::string_view remaining_path = result_pair.second;
169181+
// Empty key means the path segment could not be parsed (including malformed
169182+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
169183+
// "no progress" as a recursive lookup of "".
169184+
if (key.empty()) {
169185+
return INVALID_JSON_POINTER;
169186+
}
169079169187
// Handle when its the case for wildcard
169080169188
if (key == "*") {
169081169189
// Loop through each field in the object
@@ -169441,7 +169549,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
169441169549

169442169550
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
169443169551
if (new_capacity > max_capacity()) { return CAPACITY; }
169444-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
169552+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
169445169553

169446169554
// string_capacity copied from document::allocate
169447169555
_capacity = 0;
@@ -179337,6 +179445,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
179337179445
auto result_pair = get_next_key_and_json_path(json_path);
179338179446
std::string_view key = result_pair.first;
179339179447
std::string_view remaining_path = result_pair.second;
179448+
// Empty key means the path segment could not be parsed (including malformed
179449+
// bracket-quoted keys). Without this check, an empty key is treated as index
179450+
// 0 and remaining_path may be unchanged, causing infinite recursion.
179451+
if (key.empty()) {
179452+
return INVALID_JSON_POINTER;
179453+
}
179340179454
// Wildcard case
179341179455
if (key=="*"){
179342179456
for(auto element: *this) {
@@ -182866,6 +182980,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
182866182980
auto result_pair = get_next_key_and_json_path(json_path);
182867182981
std::string_view key = result_pair.first;
182868182982
std::string_view remaining_path = result_pair.second;
182983+
// Empty key means the path segment could not be parsed (including malformed
182984+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
182985+
// "no progress" as a recursive lookup of "".
182986+
if (key.empty()) {
182987+
return INVALID_JSON_POINTER;
182988+
}
182869182989
// Handle when its the case for wildcard
182870182990
if (key == "*") {
182871182991
// Loop through each field in the object
@@ -183231,7 +183351,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
183231183351

183232183352
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
183233183353
if (new_capacity > max_capacity()) { return CAPACITY; }
183234-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
183354+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
183235183355

183236183356
// string_capacity copied from document::allocate
183237183357
_capacity = 0;

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 21f79ce

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update simdjson to 4.6.6
PR-URL: #64942 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7a4960d commit 21f79ce

2 files changed

Lines changed: 139 additions & 19 deletions

File tree

β€Ždeps/simdjson/simdjson.cppβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.cpp: */
33
/* begin file simdjson.cpp */
44
#define SIMDJSON_SRC_SIMDJSON_CPP

β€Ždeps/simdjson/simdjson.hβ€Ž

Lines changed: 138 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.h: */
33
/* begin file simdjson.h */
44
#ifndef SIMDJSON_H
@@ -2538,7 +2538,7 @@ namespace std {
25382538
#define SIMDJSON_SIMDJSON_VERSION_H
25392539

25402540
/** The version of simdjson being used (major.minor.revision) */
2541-
#define SIMDJSON_VERSION "4.6.4"
2541+
#define SIMDJSON_VERSION "4.6.6"
25422542

25432543
namespace simdjson {
25442544
enum {
@@ -2553,7 +2553,7 @@ enum {
25532553
/**
25542554
* The revision (major.minor.REVISION) of simdjson being used.
25552555
*/
2556-
SIMDJSON_VERSION_REVISION = 4
2556+
SIMDJSON_VERSION_REVISION = 6
25572557
};
25582558
} // namespace simdjson
25592559

@@ -8067,16 +8067,28 @@ inline std::pair<std::string_view, std::string_view> get_next_key_and_json_path(
80678067
}
80688068

80698069
key = json_path.substr(key_start, i - key_start);
8070-
} else if ((i+1 < json_path.size()) && json_path[i] == '[' && (json_path[i+1] == '\'' || json_path[i+1] == '"')) {
8070+
} else if ((i + 1 < json_path.size()) && json_path[i] == '[' &&
8071+
(json_path[i + 1] == '\'' || json_path[i + 1] == '"')) {
8072+
// Bracket-quoted key: ['key'] or ["key"].
8073+
// Require a matching closing quote and a following ']'. If either is
8074+
// missing, return an empty key and the original path so callers can treat
8075+
// this as a parse failure (e.g. INVALID_JSON_POINTER) without advancing.
8076+
// Without this check, i += 2 can make i > size() and substr throws
8077+
// std::out_of_range, which aborts noexcept callers such as
8078+
// at_path_with_wildcard / for_each_at_path_with_wildcard.
8079+
const char quote = json_path[i + 1];
80718080
i += 2;
8072-
size_t key_start = i;
8073-
while (i < json_path.length() && json_path[i] != '\'' && json_path[i] != '"') {
8081+
const size_t key_start = i;
8082+
while (i < json_path.length() && json_path[i] != quote) {
80748083
++i;
80758084
}
8076-
8085+
if (i >= json_path.length() || // missing closing quote
8086+
i + 1 >= json_path.length() || // missing ]
8087+
json_path[i + 1] != ']') {
8088+
return {key, json_path};
8089+
}
80778090
key = json_path.substr(key_start, i - key_start);
8078-
8079-
i += 2;
8091+
i += 2; // past quote and ]
80808092
} else if ((i+2 < json_path.size()) && json_path[i] == '[' && json_path[i+1] == '*' && json_path[i+2] == ']') { // i.e [*].additional_keys or [*]["additional_keys"]
80818093
key = "*";
80828094
i += 3;
@@ -68653,6 +68665,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
6865368665
auto result_pair = get_next_key_and_json_path(json_path);
6865468666
std::string_view key = result_pair.first;
6865568667
std::string_view remaining_path = result_pair.second;
68668+
// Empty key means the path segment could not be parsed (including malformed
68669+
// bracket-quoted keys). Without this check, an empty key is treated as index
68670+
// 0 and remaining_path may be unchanged, causing infinite recursion.
68671+
if (key.empty()) {
68672+
return INVALID_JSON_POINTER;
68673+
}
6865668674
// Wildcard case
6865768675
if (key=="*"){
6865868676
for(auto element: *this) {
@@ -72182,6 +72200,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
7218272200
auto result_pair = get_next_key_and_json_path(json_path);
7218372201
std::string_view key = result_pair.first;
7218472202
std::string_view remaining_path = result_pair.second;
72203+
// Empty key means the path segment could not be parsed (including malformed
72204+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
72205+
// "no progress" as a recursive lookup of "".
72206+
if (key.empty()) {
72207+
return INVALID_JSON_POINTER;
72208+
}
7218572209
// Handle when its the case for wildcard
7218672210
if (key == "*") {
7218772211
// Loop through each field in the object
@@ -72547,7 +72571,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
7254772571

7254872572
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
7254972573
if (new_capacity > max_capacity()) { return CAPACITY; }
72550-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
72574+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
7255172575

7255272576
// string_capacity copied from document::allocate
7255372577
_capacity = 0;
@@ -82023,6 +82047,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
8202382047
auto result_pair = get_next_key_and_json_path(json_path);
8202482048
std::string_view key = result_pair.first;
8202582049
std::string_view remaining_path = result_pair.second;
82050+
// Empty key means the path segment could not be parsed (including malformed
82051+
// bracket-quoted keys). Without this check, an empty key is treated as index
82052+
// 0 and remaining_path may be unchanged, causing infinite recursion.
82053+
if (key.empty()) {
82054+
return INVALID_JSON_POINTER;
82055+
}
8202682056
// Wildcard case
8202782057
if (key=="*"){
8202882058
for(auto element: *this) {
@@ -85552,6 +85582,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
8555285582
auto result_pair = get_next_key_and_json_path(json_path);
8555385583
std::string_view key = result_pair.first;
8555485584
std::string_view remaining_path = result_pair.second;
85585+
// Empty key means the path segment could not be parsed (including malformed
85586+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
85587+
// "no progress" as a recursive lookup of "".
85588+
if (key.empty()) {
85589+
return INVALID_JSON_POINTER;
85590+
}
8555585591
// Handle when its the case for wildcard
8555685592
if (key == "*") {
8555785593
// Loop through each field in the object
@@ -85917,7 +85953,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
8591785953

8591885954
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
8591985955
if (new_capacity > max_capacity()) { return CAPACITY; }
85920-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
85956+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
8592185957

8592285958
// string_capacity copied from document::allocate
8592385959
_capacity = 0;
@@ -95880,6 +95916,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
9588095916
auto result_pair = get_next_key_and_json_path(json_path);
9588195917
std::string_view key = result_pair.first;
9588295918
std::string_view remaining_path = result_pair.second;
95919+
// Empty key means the path segment could not be parsed (including malformed
95920+
// bracket-quoted keys). Without this check, an empty key is treated as index
95921+
// 0 and remaining_path may be unchanged, causing infinite recursion.
95922+
if (key.empty()) {
95923+
return INVALID_JSON_POINTER;
95924+
}
9588395925
// Wildcard case
9588495926
if (key=="*"){
9588595927
for(auto element: *this) {
@@ -99409,6 +99451,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
9940999451
auto result_pair = get_next_key_and_json_path(json_path);
9941099452
std::string_view key = result_pair.first;
9941199453
std::string_view remaining_path = result_pair.second;
99454+
// Empty key means the path segment could not be parsed (including malformed
99455+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
99456+
// "no progress" as a recursive lookup of "".
99457+
if (key.empty()) {
99458+
return INVALID_JSON_POINTER;
99459+
}
9941299460
// Handle when its the case for wildcard
9941399461
if (key == "*") {
9941499462
// Loop through each field in the object
@@ -99774,7 +99822,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
9977499822

9977599823
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
9977699824
if (new_capacity > max_capacity()) { return CAPACITY; }
99777-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
99825+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
9977899826

9977999827
// string_capacity copied from document::allocate
9978099828
_capacity = 0;
@@ -109737,6 +109785,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
109737109785
auto result_pair = get_next_key_and_json_path(json_path);
109738109786
std::string_view key = result_pair.first;
109739109787
std::string_view remaining_path = result_pair.second;
109788+
// Empty key means the path segment could not be parsed (including malformed
109789+
// bracket-quoted keys). Without this check, an empty key is treated as index
109790+
// 0 and remaining_path may be unchanged, causing infinite recursion.
109791+
if (key.empty()) {
109792+
return INVALID_JSON_POINTER;
109793+
}
109740109794
// Wildcard case
109741109795
if (key=="*"){
109742109796
for(auto element: *this) {
@@ -113266,6 +113320,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
113266113320
auto result_pair = get_next_key_and_json_path(json_path);
113267113321
std::string_view key = result_pair.first;
113268113322
std::string_view remaining_path = result_pair.second;
113323+
// Empty key means the path segment could not be parsed (including malformed
113324+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
113325+
// "no progress" as a recursive lookup of "".
113326+
if (key.empty()) {
113327+
return INVALID_JSON_POINTER;
113328+
}
113269113329
// Handle when its the case for wildcard
113270113330
if (key == "*") {
113271113331
// Loop through each field in the object
@@ -113631,7 +113691,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
113631113691

113632113692
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
113633113693
if (new_capacity > max_capacity()) { return CAPACITY; }
113634-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
113694+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
113635113695

113636113696
// string_capacity copied from document::allocate
113637113697
_capacity = 0;
@@ -123709,6 +123769,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
123709123769
auto result_pair = get_next_key_and_json_path(json_path);
123710123770
std::string_view key = result_pair.first;
123711123771
std::string_view remaining_path = result_pair.second;
123772+
// Empty key means the path segment could not be parsed (including malformed
123773+
// bracket-quoted keys). Without this check, an empty key is treated as index
123774+
// 0 and remaining_path may be unchanged, causing infinite recursion.
123775+
if (key.empty()) {
123776+
return INVALID_JSON_POINTER;
123777+
}
123712123778
// Wildcard case
123713123779
if (key=="*"){
123714123780
for(auto element: *this) {
@@ -127238,6 +127304,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
127238127304
auto result_pair = get_next_key_and_json_path(json_path);
127239127305
std::string_view key = result_pair.first;
127240127306
std::string_view remaining_path = result_pair.second;
127307+
// Empty key means the path segment could not be parsed (including malformed
127308+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
127309+
// "no progress" as a recursive lookup of "".
127310+
if (key.empty()) {
127311+
return INVALID_JSON_POINTER;
127312+
}
127241127313
// Handle when its the case for wildcard
127242127314
if (key == "*") {
127243127315
// Loop through each field in the object
@@ -127603,7 +127675,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
127603127675

127604127676
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
127605127677
if (new_capacity > max_capacity()) { return CAPACITY; }
127606-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
127678+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
127607127679

127608127680
// string_capacity copied from document::allocate
127609127681
_capacity = 0;
@@ -137998,6 +138070,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
137998138070
auto result_pair = get_next_key_and_json_path(json_path);
137999138071
std::string_view key = result_pair.first;
138000138072
std::string_view remaining_path = result_pair.second;
138073+
// Empty key means the path segment could not be parsed (including malformed
138074+
// bracket-quoted keys). Without this check, an empty key is treated as index
138075+
// 0 and remaining_path may be unchanged, causing infinite recursion.
138076+
if (key.empty()) {
138077+
return INVALID_JSON_POINTER;
138078+
}
138001138079
// Wildcard case
138002138080
if (key=="*"){
138003138081
for(auto element: *this) {
@@ -141527,6 +141605,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
141527141605
auto result_pair = get_next_key_and_json_path(json_path);
141528141606
std::string_view key = result_pair.first;
141529141607
std::string_view remaining_path = result_pair.second;
141608+
// Empty key means the path segment could not be parsed (including malformed
141609+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
141610+
// "no progress" as a recursive lookup of "".
141611+
if (key.empty()) {
141612+
return INVALID_JSON_POINTER;
141613+
}
141530141614
// Handle when its the case for wildcard
141531141615
if (key == "*") {
141532141616
// Loop through each field in the object
@@ -141892,7 +141976,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
141892141976

141893141977
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
141894141978
if (new_capacity > max_capacity()) { return CAPACITY; }
141895-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
141979+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
141896141980

141897141981
// string_capacity copied from document::allocate
141898141982
_capacity = 0;
@@ -151761,6 +151845,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
151761151845
auto result_pair = get_next_key_and_json_path(json_path);
151762151846
std::string_view key = result_pair.first;
151763151847
std::string_view remaining_path = result_pair.second;
151848+
// Empty key means the path segment could not be parsed (including malformed
151849+
// bracket-quoted keys). Without this check, an empty key is treated as index
151850+
// 0 and remaining_path may be unchanged, causing infinite recursion.
151851+
if (key.empty()) {
151852+
return INVALID_JSON_POINTER;
151853+
}
151764151854
// Wildcard case
151765151855
if (key=="*"){
151766151856
for(auto element: *this) {
@@ -155290,6 +155380,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
155290155380
auto result_pair = get_next_key_and_json_path(json_path);
155291155381
std::string_view key = result_pair.first;
155292155382
std::string_view remaining_path = result_pair.second;
155383+
// Empty key means the path segment could not be parsed (including malformed
155384+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
155385+
// "no progress" as a recursive lookup of "".
155386+
if (key.empty()) {
155387+
return INVALID_JSON_POINTER;
155388+
}
155293155389
// Handle when its the case for wildcard
155294155390
if (key == "*") {
155295155391
// Loop through each field in the object
@@ -155655,7 +155751,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
155655155751

155656155752
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
155657155753
if (new_capacity > max_capacity()) { return CAPACITY; }
155658-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
155754+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
155659155755

155660155756
// string_capacity copied from document::allocate
155661155757
_capacity = 0;
@@ -165547,6 +165643,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
165547165643
auto result_pair = get_next_key_and_json_path(json_path);
165548165644
std::string_view key = result_pair.first;
165549165645
std::string_view remaining_path = result_pair.second;
165646+
// Empty key means the path segment could not be parsed (including malformed
165647+
// bracket-quoted keys). Without this check, an empty key is treated as index
165648+
// 0 and remaining_path may be unchanged, causing infinite recursion.
165649+
if (key.empty()) {
165650+
return INVALID_JSON_POINTER;
165651+
}
165550165652
// Wildcard case
165551165653
if (key=="*"){
165552165654
for(auto element: *this) {
@@ -169076,6 +169178,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
169076169178
auto result_pair = get_next_key_and_json_path(json_path);
169077169179
std::string_view key = result_pair.first;
169078169180
std::string_view remaining_path = result_pair.second;
169181+
// Empty key means the path segment could not be parsed (including malformed
169182+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
169183+
// "no progress" as a recursive lookup of "".
169184+
if (key.empty()) {
169185+
return INVALID_JSON_POINTER;
169186+
}
169079169187
// Handle when its the case for wildcard
169080169188
if (key == "*") {
169081169189
// Loop through each field in the object
@@ -169441,7 +169549,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
169441169549

169442169550
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
169443169551
if (new_capacity > max_capacity()) { return CAPACITY; }
169444-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
169552+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
169445169553

169446169554
// string_capacity copied from document::allocate
169447169555
_capacity = 0;
@@ -179337,6 +179445,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
179337179445
auto result_pair = get_next_key_and_json_path(json_path);
179338179446
std::string_view key = result_pair.first;
179339179447
std::string_view remaining_path = result_pair.second;
179448+
// Empty key means the path segment could not be parsed (including malformed
179449+
// bracket-quoted keys). Without this check, an empty key is treated as index
179450+
// 0 and remaining_path may be unchanged, causing infinite recursion.
179451+
if (key.empty()) {
179452+
return INVALID_JSON_POINTER;
179453+
}
179340179454
// Wildcard case
179341179455
if (key=="*"){
179342179456
for(auto element: *this) {
@@ -182866,6 +182980,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
182866182980
auto result_pair = get_next_key_and_json_path(json_path);
182867182981
std::string_view key = result_pair.first;
182868182982
std::string_view remaining_path = result_pair.second;
182983+
// Empty key means the path segment could not be parsed (including malformed
182984+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
182985+
// "no progress" as a recursive lookup of "".
182986+
if (key.empty()) {
182987+
return INVALID_JSON_POINTER;
182988+
}
182869182989
// Handle when its the case for wildcard
182870182990
if (key == "*") {
182871182991
// Loop through each field in the object
@@ -183231,7 +183351,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
183231183351

183232183352
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
183233183353
if (new_capacity > max_capacity()) { return CAPACITY; }
183234-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
183354+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
183235183355

183236183356
// string_capacity copied from document::allocate
183237183357
_capacity = 0;

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 21f79ce

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update simdjson to 4.6.6
PR-URL: #64942 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7a4960d commit 21f79ce

2 files changed

Lines changed: 139 additions & 19 deletions

File tree

β€Ždeps/simdjson/simdjson.cppβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.cpp: */
33
/* begin file simdjson.cpp */
44
#define SIMDJSON_SRC_SIMDJSON_CPP

β€Ždeps/simdjson/simdjson.hβ€Ž

Lines changed: 138 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.h: */
33
/* begin file simdjson.h */
44
#ifndef SIMDJSON_H
@@ -2538,7 +2538,7 @@ namespace std {
25382538
#define SIMDJSON_SIMDJSON_VERSION_H
25392539

25402540
/** The version of simdjson being used (major.minor.revision) */
2541-
#define SIMDJSON_VERSION "4.6.4"
2541+
#define SIMDJSON_VERSION "4.6.6"
25422542

25432543
namespace simdjson {
25442544
enum {
@@ -2553,7 +2553,7 @@ enum {
25532553
/**
25542554
* The revision (major.minor.REVISION) of simdjson being used.
25552555
*/
2556-
SIMDJSON_VERSION_REVISION = 4
2556+
SIMDJSON_VERSION_REVISION = 6
25572557
};
25582558
} // namespace simdjson
25592559

@@ -8067,16 +8067,28 @@ inline std::pair<std::string_view, std::string_view> get_next_key_and_json_path(
80678067
}
80688068

80698069
key = json_path.substr(key_start, i - key_start);
8070-
} else if ((i+1 < json_path.size()) && json_path[i] == '[' && (json_path[i+1] == '\'' || json_path[i+1] == '"')) {
8070+
} else if ((i + 1 < json_path.size()) && json_path[i] == '[' &&
8071+
(json_path[i + 1] == '\'' || json_path[i + 1] == '"')) {
8072+
// Bracket-quoted key: ['key'] or ["key"].
8073+
// Require a matching closing quote and a following ']'. If either is
8074+
// missing, return an empty key and the original path so callers can treat
8075+
// this as a parse failure (e.g. INVALID_JSON_POINTER) without advancing.
8076+
// Without this check, i += 2 can make i > size() and substr throws
8077+
// std::out_of_range, which aborts noexcept callers such as
8078+
// at_path_with_wildcard / for_each_at_path_with_wildcard.
8079+
const char quote = json_path[i + 1];
80718080
i += 2;
8072-
size_t key_start = i;
8073-
while (i < json_path.length() && json_path[i] != '\'' && json_path[i] != '"') {
8081+
const size_t key_start = i;
8082+
while (i < json_path.length() && json_path[i] != quote) {
80748083
++i;
80758084
}
8076-
8085+
if (i >= json_path.length() || // missing closing quote
8086+
i + 1 >= json_path.length() || // missing ]
8087+
json_path[i + 1] != ']') {
8088+
return {key, json_path};
8089+
}
80778090
key = json_path.substr(key_start, i - key_start);
8078-
8079-
i += 2;
8091+
i += 2; // past quote and ]
80808092
} else if ((i+2 < json_path.size()) && json_path[i] == '[' && json_path[i+1] == '*' && json_path[i+2] == ']') { // i.e [*].additional_keys or [*]["additional_keys"]
80818093
key = "*";
80828094
i += 3;
@@ -68653,6 +68665,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
6865368665
auto result_pair = get_next_key_and_json_path(json_path);
6865468666
std::string_view key = result_pair.first;
6865568667
std::string_view remaining_path = result_pair.second;
68668+
// Empty key means the path segment could not be parsed (including malformed
68669+
// bracket-quoted keys). Without this check, an empty key is treated as index
68670+
// 0 and remaining_path may be unchanged, causing infinite recursion.
68671+
if (key.empty()) {
68672+
return INVALID_JSON_POINTER;
68673+
}
6865668674
// Wildcard case
6865768675
if (key=="*"){
6865868676
for(auto element: *this) {
@@ -72182,6 +72200,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
7218272200
auto result_pair = get_next_key_and_json_path(json_path);
7218372201
std::string_view key = result_pair.first;
7218472202
std::string_view remaining_path = result_pair.second;
72203+
// Empty key means the path segment could not be parsed (including malformed
72204+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
72205+
// "no progress" as a recursive lookup of "".
72206+
if (key.empty()) {
72207+
return INVALID_JSON_POINTER;
72208+
}
7218572209
// Handle when its the case for wildcard
7218672210
if (key == "*") {
7218772211
// Loop through each field in the object
@@ -72547,7 +72571,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
7254772571

7254872572
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
7254972573
if (new_capacity > max_capacity()) { return CAPACITY; }
72550-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
72574+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
7255172575

7255272576
// string_capacity copied from document::allocate
7255372577
_capacity = 0;
@@ -82023,6 +82047,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
8202382047
auto result_pair = get_next_key_and_json_path(json_path);
8202482048
std::string_view key = result_pair.first;
8202582049
std::string_view remaining_path = result_pair.second;
82050+
// Empty key means the path segment could not be parsed (including malformed
82051+
// bracket-quoted keys). Without this check, an empty key is treated as index
82052+
// 0 and remaining_path may be unchanged, causing infinite recursion.
82053+
if (key.empty()) {
82054+
return INVALID_JSON_POINTER;
82055+
}
8202682056
// Wildcard case
8202782057
if (key=="*"){
8202882058
for(auto element: *this) {
@@ -85552,6 +85582,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
8555285582
auto result_pair = get_next_key_and_json_path(json_path);
8555385583
std::string_view key = result_pair.first;
8555485584
std::string_view remaining_path = result_pair.second;
85585+
// Empty key means the path segment could not be parsed (including malformed
85586+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
85587+
// "no progress" as a recursive lookup of "".
85588+
if (key.empty()) {
85589+
return INVALID_JSON_POINTER;
85590+
}
8555585591
// Handle when its the case for wildcard
8555685592
if (key == "*") {
8555785593
// Loop through each field in the object
@@ -85917,7 +85953,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
8591785953

8591885954
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
8591985955
if (new_capacity > max_capacity()) { return CAPACITY; }
85920-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
85956+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
8592185957

8592285958
// string_capacity copied from document::allocate
8592385959
_capacity = 0;
@@ -95880,6 +95916,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
9588095916
auto result_pair = get_next_key_and_json_path(json_path);
9588195917
std::string_view key = result_pair.first;
9588295918
std::string_view remaining_path = result_pair.second;
95919+
// Empty key means the path segment could not be parsed (including malformed
95920+
// bracket-quoted keys). Without this check, an empty key is treated as index
95921+
// 0 and remaining_path may be unchanged, causing infinite recursion.
95922+
if (key.empty()) {
95923+
return INVALID_JSON_POINTER;
95924+
}
9588395925
// Wildcard case
9588495926
if (key=="*"){
9588595927
for(auto element: *this) {
@@ -99409,6 +99451,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
9940999451
auto result_pair = get_next_key_and_json_path(json_path);
9941099452
std::string_view key = result_pair.first;
9941199453
std::string_view remaining_path = result_pair.second;
99454+
// Empty key means the path segment could not be parsed (including malformed
99455+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
99456+
// "no progress" as a recursive lookup of "".
99457+
if (key.empty()) {
99458+
return INVALID_JSON_POINTER;
99459+
}
9941299460
// Handle when its the case for wildcard
9941399461
if (key == "*") {
9941499462
// Loop through each field in the object
@@ -99774,7 +99822,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
9977499822

9977599823
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
9977699824
if (new_capacity > max_capacity()) { return CAPACITY; }
99777-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
99825+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
9977899826

9977999827
// string_capacity copied from document::allocate
9978099828
_capacity = 0;
@@ -109737,6 +109785,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
109737109785
auto result_pair = get_next_key_and_json_path(json_path);
109738109786
std::string_view key = result_pair.first;
109739109787
std::string_view remaining_path = result_pair.second;
109788+
// Empty key means the path segment could not be parsed (including malformed
109789+
// bracket-quoted keys). Without this check, an empty key is treated as index
109790+
// 0 and remaining_path may be unchanged, causing infinite recursion.
109791+
if (key.empty()) {
109792+
return INVALID_JSON_POINTER;
109793+
}
109740109794
// Wildcard case
109741109795
if (key=="*"){
109742109796
for(auto element: *this) {
@@ -113266,6 +113320,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
113266113320
auto result_pair = get_next_key_and_json_path(json_path);
113267113321
std::string_view key = result_pair.first;
113268113322
std::string_view remaining_path = result_pair.second;
113323+
// Empty key means the path segment could not be parsed (including malformed
113324+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
113325+
// "no progress" as a recursive lookup of "".
113326+
if (key.empty()) {
113327+
return INVALID_JSON_POINTER;
113328+
}
113269113329
// Handle when its the case for wildcard
113270113330
if (key == "*") {
113271113331
// Loop through each field in the object
@@ -113631,7 +113691,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
113631113691

113632113692
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
113633113693
if (new_capacity > max_capacity()) { return CAPACITY; }
113634-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
113694+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
113635113695

113636113696
// string_capacity copied from document::allocate
113637113697
_capacity = 0;
@@ -123709,6 +123769,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
123709123769
auto result_pair = get_next_key_and_json_path(json_path);
123710123770
std::string_view key = result_pair.first;
123711123771
std::string_view remaining_path = result_pair.second;
123772+
// Empty key means the path segment could not be parsed (including malformed
123773+
// bracket-quoted keys). Without this check, an empty key is treated as index
123774+
// 0 and remaining_path may be unchanged, causing infinite recursion.
123775+
if (key.empty()) {
123776+
return INVALID_JSON_POINTER;
123777+
}
123712123778
// Wildcard case
123713123779
if (key=="*"){
123714123780
for(auto element: *this) {
@@ -127238,6 +127304,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
127238127304
auto result_pair = get_next_key_and_json_path(json_path);
127239127305
std::string_view key = result_pair.first;
127240127306
std::string_view remaining_path = result_pair.second;
127307+
// Empty key means the path segment could not be parsed (including malformed
127308+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
127309+
// "no progress" as a recursive lookup of "".
127310+
if (key.empty()) {
127311+
return INVALID_JSON_POINTER;
127312+
}
127241127313
// Handle when its the case for wildcard
127242127314
if (key == "*") {
127243127315
// Loop through each field in the object
@@ -127603,7 +127675,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
127603127675

127604127676
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
127605127677
if (new_capacity > max_capacity()) { return CAPACITY; }
127606-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
127678+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
127607127679

127608127680
// string_capacity copied from document::allocate
127609127681
_capacity = 0;
@@ -137998,6 +138070,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
137998138070
auto result_pair = get_next_key_and_json_path(json_path);
137999138071
std::string_view key = result_pair.first;
138000138072
std::string_view remaining_path = result_pair.second;
138073+
// Empty key means the path segment could not be parsed (including malformed
138074+
// bracket-quoted keys). Without this check, an empty key is treated as index
138075+
// 0 and remaining_path may be unchanged, causing infinite recursion.
138076+
if (key.empty()) {
138077+
return INVALID_JSON_POINTER;
138078+
}
138001138079
// Wildcard case
138002138080
if (key=="*"){
138003138081
for(auto element: *this) {
@@ -141527,6 +141605,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
141527141605
auto result_pair = get_next_key_and_json_path(json_path);
141528141606
std::string_view key = result_pair.first;
141529141607
std::string_view remaining_path = result_pair.second;
141608+
// Empty key means the path segment could not be parsed (including malformed
141609+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
141610+
// "no progress" as a recursive lookup of "".
141611+
if (key.empty()) {
141612+
return INVALID_JSON_POINTER;
141613+
}
141530141614
// Handle when its the case for wildcard
141531141615
if (key == "*") {
141532141616
// Loop through each field in the object
@@ -141892,7 +141976,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
141892141976

141893141977
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
141894141978
if (new_capacity > max_capacity()) { return CAPACITY; }
141895-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
141979+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
141896141980

141897141981
// string_capacity copied from document::allocate
141898141982
_capacity = 0;
@@ -151761,6 +151845,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
151761151845
auto result_pair = get_next_key_and_json_path(json_path);
151762151846
std::string_view key = result_pair.first;
151763151847
std::string_view remaining_path = result_pair.second;
151848+
// Empty key means the path segment could not be parsed (including malformed
151849+
// bracket-quoted keys). Without this check, an empty key is treated as index
151850+
// 0 and remaining_path may be unchanged, causing infinite recursion.
151851+
if (key.empty()) {
151852+
return INVALID_JSON_POINTER;
151853+
}
151764151854
// Wildcard case
151765151855
if (key=="*"){
151766151856
for(auto element: *this) {
@@ -155290,6 +155380,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
155290155380
auto result_pair = get_next_key_and_json_path(json_path);
155291155381
std::string_view key = result_pair.first;
155292155382
std::string_view remaining_path = result_pair.second;
155383+
// Empty key means the path segment could not be parsed (including malformed
155384+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
155385+
// "no progress" as a recursive lookup of "".
155386+
if (key.empty()) {
155387+
return INVALID_JSON_POINTER;
155388+
}
155293155389
// Handle when its the case for wildcard
155294155390
if (key == "*") {
155295155391
// Loop through each field in the object
@@ -155655,7 +155751,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
155655155751

155656155752
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
155657155753
if (new_capacity > max_capacity()) { return CAPACITY; }
155658-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
155754+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
155659155755

155660155756
// string_capacity copied from document::allocate
155661155757
_capacity = 0;
@@ -165547,6 +165643,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
165547165643
auto result_pair = get_next_key_and_json_path(json_path);
165548165644
std::string_view key = result_pair.first;
165549165645
std::string_view remaining_path = result_pair.second;
165646+
// Empty key means the path segment could not be parsed (including malformed
165647+
// bracket-quoted keys). Without this check, an empty key is treated as index
165648+
// 0 and remaining_path may be unchanged, causing infinite recursion.
165649+
if (key.empty()) {
165650+
return INVALID_JSON_POINTER;
165651+
}
165550165652
// Wildcard case
165551165653
if (key=="*"){
165552165654
for(auto element: *this) {
@@ -169076,6 +169178,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
169076169178
auto result_pair = get_next_key_and_json_path(json_path);
169077169179
std::string_view key = result_pair.first;
169078169180
std::string_view remaining_path = result_pair.second;
169181+
// Empty key means the path segment could not be parsed (including malformed
169182+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
169183+
// "no progress" as a recursive lookup of "".
169184+
if (key.empty()) {
169185+
return INVALID_JSON_POINTER;
169186+
}
169079169187
// Handle when its the case for wildcard
169080169188
if (key == "*") {
169081169189
// Loop through each field in the object
@@ -169441,7 +169549,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
169441169549

169442169550
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
169443169551
if (new_capacity > max_capacity()) { return CAPACITY; }
169444-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
169552+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
169445169553

169446169554
// string_capacity copied from document::allocate
169447169555
_capacity = 0;
@@ -179337,6 +179445,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
179337179445
auto result_pair = get_next_key_and_json_path(json_path);
179338179446
std::string_view key = result_pair.first;
179339179447
std::string_view remaining_path = result_pair.second;
179448+
// Empty key means the path segment could not be parsed (including malformed
179449+
// bracket-quoted keys). Without this check, an empty key is treated as index
179450+
// 0 and remaining_path may be unchanged, causing infinite recursion.
179451+
if (key.empty()) {
179452+
return INVALID_JSON_POINTER;
179453+
}
179340179454
// Wildcard case
179341179455
if (key=="*"){
179342179456
for(auto element: *this) {
@@ -182866,6 +182980,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
182866182980
auto result_pair = get_next_key_and_json_path(json_path);
182867182981
std::string_view key = result_pair.first;
182868182982
std::string_view remaining_path = result_pair.second;
182983+
// Empty key means the path segment could not be parsed (including malformed
182984+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
182985+
// "no progress" as a recursive lookup of "".
182986+
if (key.empty()) {
182987+
return INVALID_JSON_POINTER;
182988+
}
182869182989
// Handle when its the case for wildcard
182870182990
if (key == "*") {
182871182991
// Loop through each field in the object
@@ -183231,7 +183351,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
183231183351

183232183352
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
183233183353
if (new_capacity > max_capacity()) { return CAPACITY; }
183234-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
183354+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
183235183355

183236183356
// string_capacity copied from document::allocate
183237183357
_capacity = 0;

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Commit 21f79ce

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update simdjson to 4.6.6
PR-URL: #64942 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7a4960d commit 21f79ce

2 files changed

Lines changed: 139 additions & 19 deletions

File tree

β€Ždeps/simdjson/simdjson.cppβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.cpp: */
33
/* begin file simdjson.cpp */
44
#define SIMDJSON_SRC_SIMDJSON_CPP

β€Ždeps/simdjson/simdjson.hβ€Ž

Lines changed: 138 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2026-05-06 17:28:39 -0400. version 4.6.4 Do not edit! */
1+
/* auto-generated on 2026-07-30 16:20:13 -0400. version 4.6.6 Do not edit! */
22
/* including simdjson.h: */
33
/* begin file simdjson.h */
44
#ifndef SIMDJSON_H
@@ -2538,7 +2538,7 @@ namespace std {
25382538
#define SIMDJSON_SIMDJSON_VERSION_H
25392539

25402540
/** The version of simdjson being used (major.minor.revision) */
2541-
#define SIMDJSON_VERSION "4.6.4"
2541+
#define SIMDJSON_VERSION "4.6.6"
25422542

25432543
namespace simdjson {
25442544
enum {
@@ -2553,7 +2553,7 @@ enum {
25532553
/**
25542554
* The revision (major.minor.REVISION) of simdjson being used.
25552555
*/
2556-
SIMDJSON_VERSION_REVISION = 4
2556+
SIMDJSON_VERSION_REVISION = 6
25572557
};
25582558
} // namespace simdjson
25592559

@@ -8067,16 +8067,28 @@ inline std::pair<std::string_view, std::string_view> get_next_key_and_json_path(
80678067
}
80688068

80698069
key = json_path.substr(key_start, i - key_start);
8070-
} else if ((i+1 < json_path.size()) && json_path[i] == '[' && (json_path[i+1] == '\'' || json_path[i+1] == '"')) {
8070+
} else if ((i + 1 < json_path.size()) && json_path[i] == '[' &&
8071+
(json_path[i + 1] == '\'' || json_path[i + 1] == '"')) {
8072+
// Bracket-quoted key: ['key'] or ["key"].
8073+
// Require a matching closing quote and a following ']'. If either is
8074+
// missing, return an empty key and the original path so callers can treat
8075+
// this as a parse failure (e.g. INVALID_JSON_POINTER) without advancing.
8076+
// Without this check, i += 2 can make i > size() and substr throws
8077+
// std::out_of_range, which aborts noexcept callers such as
8078+
// at_path_with_wildcard / for_each_at_path_with_wildcard.
8079+
const char quote = json_path[i + 1];
80718080
i += 2;
8072-
size_t key_start = i;
8073-
while (i < json_path.length() && json_path[i] != '\'' && json_path[i] != '"') {
8081+
const size_t key_start = i;
8082+
while (i < json_path.length() && json_path[i] != quote) {
80748083
++i;
80758084
}
8076-
8085+
if (i >= json_path.length() || // missing closing quote
8086+
i + 1 >= json_path.length() || // missing ]
8087+
json_path[i + 1] != ']') {
8088+
return {key, json_path};
8089+
}
80778090
key = json_path.substr(key_start, i - key_start);
8078-
8079-
i += 2;
8091+
i += 2; // past quote and ]
80808092
} else if ((i+2 < json_path.size()) && json_path[i] == '[' && json_path[i+1] == '*' && json_path[i+2] == ']') { // i.e [*].additional_keys or [*]["additional_keys"]
80818093
key = "*";
80828094
i += 3;
@@ -68653,6 +68665,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
6865368665
auto result_pair = get_next_key_and_json_path(json_path);
6865468666
std::string_view key = result_pair.first;
6865568667
std::string_view remaining_path = result_pair.second;
68668+
// Empty key means the path segment could not be parsed (including malformed
68669+
// bracket-quoted keys). Without this check, an empty key is treated as index
68670+
// 0 and remaining_path may be unchanged, causing infinite recursion.
68671+
if (key.empty()) {
68672+
return INVALID_JSON_POINTER;
68673+
}
6865668674
// Wildcard case
6865768675
if (key=="*"){
6865868676
for(auto element: *this) {
@@ -72182,6 +72200,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
7218272200
auto result_pair = get_next_key_and_json_path(json_path);
7218372201
std::string_view key = result_pair.first;
7218472202
std::string_view remaining_path = result_pair.second;
72203+
// Empty key means the path segment could not be parsed (including malformed
72204+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
72205+
// "no progress" as a recursive lookup of "".
72206+
if (key.empty()) {
72207+
return INVALID_JSON_POINTER;
72208+
}
7218572209
// Handle when its the case for wildcard
7218672210
if (key == "*") {
7218772211
// Loop through each field in the object
@@ -72547,7 +72571,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
7254772571

7254872572
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
7254972573
if (new_capacity > max_capacity()) { return CAPACITY; }
72550-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
72574+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
7255172575

7255272576
// string_capacity copied from document::allocate
7255372577
_capacity = 0;
@@ -82023,6 +82047,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
8202382047
auto result_pair = get_next_key_and_json_path(json_path);
8202482048
std::string_view key = result_pair.first;
8202582049
std::string_view remaining_path = result_pair.second;
82050+
// Empty key means the path segment could not be parsed (including malformed
82051+
// bracket-quoted keys). Without this check, an empty key is treated as index
82052+
// 0 and remaining_path may be unchanged, causing infinite recursion.
82053+
if (key.empty()) {
82054+
return INVALID_JSON_POINTER;
82055+
}
8202682056
// Wildcard case
8202782057
if (key=="*"){
8202882058
for(auto element: *this) {
@@ -85552,6 +85582,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
8555285582
auto result_pair = get_next_key_and_json_path(json_path);
8555385583
std::string_view key = result_pair.first;
8555485584
std::string_view remaining_path = result_pair.second;
85585+
// Empty key means the path segment could not be parsed (including malformed
85586+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
85587+
// "no progress" as a recursive lookup of "".
85588+
if (key.empty()) {
85589+
return INVALID_JSON_POINTER;
85590+
}
8555585591
// Handle when its the case for wildcard
8555685592
if (key == "*") {
8555785593
// Loop through each field in the object
@@ -85917,7 +85953,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
8591785953

8591885954
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
8591985955
if (new_capacity > max_capacity()) { return CAPACITY; }
85920-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
85956+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
8592185957

8592285958
// string_capacity copied from document::allocate
8592385959
_capacity = 0;
@@ -95880,6 +95916,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
9588095916
auto result_pair = get_next_key_and_json_path(json_path);
9588195917
std::string_view key = result_pair.first;
9588295918
std::string_view remaining_path = result_pair.second;
95919+
// Empty key means the path segment could not be parsed (including malformed
95920+
// bracket-quoted keys). Without this check, an empty key is treated as index
95921+
// 0 and remaining_path may be unchanged, causing infinite recursion.
95922+
if (key.empty()) {
95923+
return INVALID_JSON_POINTER;
95924+
}
9588395925
// Wildcard case
9588495926
if (key=="*"){
9588595927
for(auto element: *this) {
@@ -99409,6 +99451,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
9940999451
auto result_pair = get_next_key_and_json_path(json_path);
9941099452
std::string_view key = result_pair.first;
9941199453
std::string_view remaining_path = result_pair.second;
99454+
// Empty key means the path segment could not be parsed (including malformed
99455+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
99456+
// "no progress" as a recursive lookup of "".
99457+
if (key.empty()) {
99458+
return INVALID_JSON_POINTER;
99459+
}
9941299460
// Handle when its the case for wildcard
9941399461
if (key == "*") {
9941499462
// Loop through each field in the object
@@ -99774,7 +99822,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
9977499822

9977599823
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
9977699824
if (new_capacity > max_capacity()) { return CAPACITY; }
99777-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
99825+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
9977899826

9977999827
// string_capacity copied from document::allocate
9978099828
_capacity = 0;
@@ -109737,6 +109785,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
109737109785
auto result_pair = get_next_key_and_json_path(json_path);
109738109786
std::string_view key = result_pair.first;
109739109787
std::string_view remaining_path = result_pair.second;
109788+
// Empty key means the path segment could not be parsed (including malformed
109789+
// bracket-quoted keys). Without this check, an empty key is treated as index
109790+
// 0 and remaining_path may be unchanged, causing infinite recursion.
109791+
if (key.empty()) {
109792+
return INVALID_JSON_POINTER;
109793+
}
109740109794
// Wildcard case
109741109795
if (key=="*"){
109742109796
for(auto element: *this) {
@@ -113266,6 +113320,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
113266113320
auto result_pair = get_next_key_and_json_path(json_path);
113267113321
std::string_view key = result_pair.first;
113268113322
std::string_view remaining_path = result_pair.second;
113323+
// Empty key means the path segment could not be parsed (including malformed
113324+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
113325+
// "no progress" as a recursive lookup of "".
113326+
if (key.empty()) {
113327+
return INVALID_JSON_POINTER;
113328+
}
113269113329
// Handle when its the case for wildcard
113270113330
if (key == "*") {
113271113331
// Loop through each field in the object
@@ -113631,7 +113691,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
113631113691

113632113692
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
113633113693
if (new_capacity > max_capacity()) { return CAPACITY; }
113634-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
113694+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
113635113695

113636113696
// string_capacity copied from document::allocate
113637113697
_capacity = 0;
@@ -123709,6 +123769,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
123709123769
auto result_pair = get_next_key_and_json_path(json_path);
123710123770
std::string_view key = result_pair.first;
123711123771
std::string_view remaining_path = result_pair.second;
123772+
// Empty key means the path segment could not be parsed (including malformed
123773+
// bracket-quoted keys). Without this check, an empty key is treated as index
123774+
// 0 and remaining_path may be unchanged, causing infinite recursion.
123775+
if (key.empty()) {
123776+
return INVALID_JSON_POINTER;
123777+
}
123712123778
// Wildcard case
123713123779
if (key=="*"){
123714123780
for(auto element: *this) {
@@ -127238,6 +127304,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
127238127304
auto result_pair = get_next_key_and_json_path(json_path);
127239127305
std::string_view key = result_pair.first;
127240127306
std::string_view remaining_path = result_pair.second;
127307+
// Empty key means the path segment could not be parsed (including malformed
127308+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
127309+
// "no progress" as a recursive lookup of "".
127310+
if (key.empty()) {
127311+
return INVALID_JSON_POINTER;
127312+
}
127241127313
// Handle when its the case for wildcard
127242127314
if (key == "*") {
127243127315
// Loop through each field in the object
@@ -127603,7 +127675,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
127603127675

127604127676
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
127605127677
if (new_capacity > max_capacity()) { return CAPACITY; }
127606-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
127678+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
127607127679

127608127680
// string_capacity copied from document::allocate
127609127681
_capacity = 0;
@@ -137998,6 +138070,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
137998138070
auto result_pair = get_next_key_and_json_path(json_path);
137999138071
std::string_view key = result_pair.first;
138000138072
std::string_view remaining_path = result_pair.second;
138073+
// Empty key means the path segment could not be parsed (including malformed
138074+
// bracket-quoted keys). Without this check, an empty key is treated as index
138075+
// 0 and remaining_path may be unchanged, causing infinite recursion.
138076+
if (key.empty()) {
138077+
return INVALID_JSON_POINTER;
138078+
}
138001138079
// Wildcard case
138002138080
if (key=="*"){
138003138081
for(auto element: *this) {
@@ -141527,6 +141605,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
141527141605
auto result_pair = get_next_key_and_json_path(json_path);
141528141606
std::string_view key = result_pair.first;
141529141607
std::string_view remaining_path = result_pair.second;
141608+
// Empty key means the path segment could not be parsed (including malformed
141609+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
141610+
// "no progress" as a recursive lookup of "".
141611+
if (key.empty()) {
141612+
return INVALID_JSON_POINTER;
141613+
}
141530141614
// Handle when its the case for wildcard
141531141615
if (key == "*") {
141532141616
// Loop through each field in the object
@@ -141892,7 +141976,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
141892141976

141893141977
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
141894141978
if (new_capacity > max_capacity()) { return CAPACITY; }
141895-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
141979+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
141896141980

141897141981
// string_capacity copied from document::allocate
141898141982
_capacity = 0;
@@ -151761,6 +151845,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
151761151845
auto result_pair = get_next_key_and_json_path(json_path);
151762151846
std::string_view key = result_pair.first;
151763151847
std::string_view remaining_path = result_pair.second;
151848+
// Empty key means the path segment could not be parsed (including malformed
151849+
// bracket-quoted keys). Without this check, an empty key is treated as index
151850+
// 0 and remaining_path may be unchanged, causing infinite recursion.
151851+
if (key.empty()) {
151852+
return INVALID_JSON_POINTER;
151853+
}
151764151854
// Wildcard case
151765151855
if (key=="*"){
151766151856
for(auto element: *this) {
@@ -155290,6 +155380,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
155290155380
auto result_pair = get_next_key_and_json_path(json_path);
155291155381
std::string_view key = result_pair.first;
155292155382
std::string_view remaining_path = result_pair.second;
155383+
// Empty key means the path segment could not be parsed (including malformed
155384+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
155385+
// "no progress" as a recursive lookup of "".
155386+
if (key.empty()) {
155387+
return INVALID_JSON_POINTER;
155388+
}
155293155389
// Handle when its the case for wildcard
155294155390
if (key == "*") {
155295155391
// Loop through each field in the object
@@ -155655,7 +155751,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
155655155751

155656155752
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
155657155753
if (new_capacity > max_capacity()) { return CAPACITY; }
155658-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
155754+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
155659155755

155660155756
// string_capacity copied from document::allocate
155661155757
_capacity = 0;
@@ -165547,6 +165643,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
165547165643
auto result_pair = get_next_key_and_json_path(json_path);
165548165644
std::string_view key = result_pair.first;
165549165645
std::string_view remaining_path = result_pair.second;
165646+
// Empty key means the path segment could not be parsed (including malformed
165647+
// bracket-quoted keys). Without this check, an empty key is treated as index
165648+
// 0 and remaining_path may be unchanged, causing infinite recursion.
165649+
if (key.empty()) {
165650+
return INVALID_JSON_POINTER;
165651+
}
165550165652
// Wildcard case
165551165653
if (key=="*"){
165552165654
for(auto element: *this) {
@@ -169076,6 +169178,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
169076169178
auto result_pair = get_next_key_and_json_path(json_path);
169077169179
std::string_view key = result_pair.first;
169078169180
std::string_view remaining_path = result_pair.second;
169181+
// Empty key means the path segment could not be parsed (including malformed
169182+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
169183+
// "no progress" as a recursive lookup of "".
169184+
if (key.empty()) {
169185+
return INVALID_JSON_POINTER;
169186+
}
169079169187
// Handle when its the case for wildcard
169080169188
if (key == "*") {
169081169189
// Loop through each field in the object
@@ -169441,7 +169549,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
169441169549

169442169550
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
169443169551
if (new_capacity > max_capacity()) { return CAPACITY; }
169444-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
169552+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
169445169553

169446169554
// string_capacity copied from document::allocate
169447169555
_capacity = 0;
@@ -179337,6 +179445,12 @@ inline error_code array::for_each_at_path_with_wildcard(std::string_view json_pa
179337179445
auto result_pair = get_next_key_and_json_path(json_path);
179338179446
std::string_view key = result_pair.first;
179339179447
std::string_view remaining_path = result_pair.second;
179448+
// Empty key means the path segment could not be parsed (including malformed
179449+
// bracket-quoted keys). Without this check, an empty key is treated as index
179450+
// 0 and remaining_path may be unchanged, causing infinite recursion.
179451+
if (key.empty()) {
179452+
return INVALID_JSON_POINTER;
179453+
}
179340179454
// Wildcard case
179341179455
if (key=="*"){
179342179456
for(auto element: *this) {
@@ -182866,6 +182980,12 @@ inline error_code object::for_each_at_path_with_wildcard(std::string_view json_p
182866182980
auto result_pair = get_next_key_and_json_path(json_path);
182867182981
std::string_view key = result_pair.first;
182868182982
std::string_view remaining_path = result_pair.second;
182983+
// Empty key means the path segment could not be parsed (including malformed
182984+
// bracket-quoted keys). Match DOM at_path_with_wildcard and avoid treating
182985+
// "no progress" as a recursive lookup of "".
182986+
if (key.empty()) {
182987+
return INVALID_JSON_POINTER;
182988+
}
182869182989
// Handle when its the case for wildcard
182870182990
if (key == "*") {
182871182991
// Loop through each field in the object
@@ -183231,7 +183351,7 @@ simdjson_inline parser::parser(size_t max_capacity) noexcept
183231183351

183232183352
simdjson_warn_unused simdjson_inline error_code parser::allocate(size_t new_capacity, size_t new_max_depth) noexcept {
183233183353
if (new_capacity > max_capacity()) { return CAPACITY; }
183234-
if (string_buf && new_capacity == capacity() && new_max_depth == max_depth()) { return SUCCESS; }
183354+
if (string_buf && new_capacity <= capacity() && new_max_depth <= max_depth()) { return SUCCESS; }
183235183355

183236183356
// string_capacity copied from document::allocate
183237183357
_capacity = 0;

0 commit comments

Comments
Β (0)