mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
Fixing issue 906 (#912)
* Fixing issue 906 * Safe patching. * Now with explanations. * Bumping up memory allocation. * Putting the patch back. * fallback fixes. Co-authored-by: Daniel Lemire <lemire@gmai.com>
This commit is contained in:
@@ -133,6 +133,10 @@ really_inline error_code scan() {
|
||||
}
|
||||
*next_structural_index = len;
|
||||
next_structural_index++;
|
||||
// We pad beyond.
|
||||
// https://github.com/simdjson/simdjson/issues/906
|
||||
next_structural_index[0] = len;
|
||||
next_structural_index[1] = 0;
|
||||
parser.n_structural_indexes = uint32_t(next_structural_index - parser.structural_indexes.get());
|
||||
return error;
|
||||
}
|
||||
@@ -234,6 +238,8 @@ namespace fallback {
|
||||
WARN_UNUSED error_code dom_parser_implementation::parse(const uint8_t *_buf, size_t _len, dom::document &_doc) noexcept {
|
||||
error_code err = stage1(_buf, _len, false);
|
||||
if (err) { return err; }
|
||||
err = check_for_unclosed_array();
|
||||
if (err) { return err; }
|
||||
return stage2(_doc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user