Correcting what seems to be a typo and adding some extra logging. (#1535)

This commit is contained in:
Daniel Lemire 2021-04-04 12:25:05 -04:00 committed by GitHub
parent 78cff7518b
commit 6ca6ee5a6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -125,12 +125,12 @@ simdjson_warn_unused simdjson_really_inline error_code json_iterator::walk_docum
{ {
auto value = advance(); auto value = advance();
// Make sure the outer hash or array is closed before continuing; otherwise, there are ways we // Make sure the outer object or array is closed before continuing; otherwise, there are ways we
// could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906 // could get into memory corruption. See https://github.com/simdjson/simdjson/issues/906
if (!STREAMING) { if (!STREAMING) {
switch (*value) { switch (*value) {
case '{': if (last_structural() != '}') { return TAPE_ERROR; }; break; case '{': if (last_structural() != '}') { log_value("starting brace unmatched"); return TAPE_ERROR; }; break;
case '[': if (last_structural() != ']') { return TAPE_ERROR; }; break; case '[': if (last_structural() != ']') { log_value("starting bracket unmatched"); return TAPE_ERROR; }; break;
} }
} }