Skip to content

wrong EndOfObject-Handling #37

Description

@thomasahlendorf

IMHO, line 278 in JsonStreamingParser.cpp is incorrect.

277 void JsonStreamingParser::endObject() {
278     int popped = stack[stackPos];
279     stackPos--;

The line should read:

278     int popped = stack[stackPos-1];

The current type is located one position below 'stackPos', a fact that is also accounted for in all other "JsonStreamingParser::endOfAnything" methods.

The problem occurs when objects and arrays are nested within each other:

{... , "array_a": [
{ ... , "array_b": [1,2,3] },<- Error (expected end of object, but read the end of the previous array instead)
{ ... , "array_c": [1,2,3] },... ]}

With the corrected line, everything is parsed correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions