@@ -376,7 +376,7 @@ WARN_UNUSED error_code implementation::stage2(const uint8_t *buf, size_t len, pa
376376object_begin:
377377 switch (parser.advance_char ()) {
378378 case ' "' : {
379- doc_parser.increment_count (parser.depth - 1 ); // we have a key value pair in the object at parser.depth - 1
379+ doc_parser.increment_count (doc_parser. containing_scope [ parser.depth - 1 ] ); // we have a key value pair in the object at parser.depth - 1
380380 FAIL_IF ( parser.parse_string () );
381381 goto object_key_state;
382382 }
@@ -395,7 +395,7 @@ WARN_UNUSED error_code implementation::stage2(const uint8_t *buf, size_t len, pa
395395object_continue:
396396 switch (parser.advance_char ()) {
397397 case ' ,' :
398- doc_parser.increment_count (parser.depth - 1 ); // we have a key value pair in the object at parser.depth - 1
398+ doc_parser.increment_count (doc_parser. containing_scope [ parser.depth - 1 ] ); // we have a key value pair in the object at parser.depth - 1
399399 FAIL_IF ( parser.advance_char () != ' "' );
400400 FAIL_IF ( parser.parse_string () );
401401 goto object_key_state;
@@ -417,7 +417,7 @@ WARN_UNUSED error_code implementation::stage2(const uint8_t *buf, size_t len, pa
417417 parser.end_array ();
418418 goto scope_end;
419419 }
420- doc_parser.increment_count (parser.depth - 1 ); // we have a new value in the array at parser.depth - 1
420+ doc_parser.increment_count (doc_parser. containing_scope [ parser.depth - 1 ] ); // we have a new value in the array at parser.depth - 1
421421
422422main_array_switch:
423423 /* we call update char on all paths in, so we can peek at parser.c on the
@@ -427,7 +427,7 @@ WARN_UNUSED error_code implementation::stage2(const uint8_t *buf, size_t len, pa
427427array_continue:
428428 switch (parser.advance_char ()) {
429429 case ' ,' :
430- doc_parser.increment_count (parser.depth - 1 ); // we have a new value in the array at parser.depth - 1
430+ doc_parser.increment_count (doc_parser. containing_scope [ parser.depth - 1 ] ); // we have a new value in the array at parser.depth - 1
431431 parser.advance_char ();
432432 goto main_array_switch;
433433 case ' ]' :
0 commit comments