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
25432543namespace simdjson {
25442544enum {
@@ -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
7254872572simdjson_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
8591885954simdjson_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
9977599823simdjson_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
113632113692simdjson_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
127604127676simdjson_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
141893141977simdjson_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
155656155752simdjson_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
169442169550simdjson_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
183232183352simdjson_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