Ensures WeaselJsonParser_reset restores the parser to its newly-created state by clearing inKey and other per-parse transient state (utf8Codepoint, utf16Surrogate, minCodepoint, numDfa, strDfa) in addition to rewinding the symbol stack. Adds a regression test for the reported callback misrouting.
Bench and DFA tests with SIGSYS failures are unrelated to this change; the parser lifecycle tests pass.
Closes #2
Ensures `WeaselJsonParser_reset` restores the parser to its newly-created state by clearing `inKey` and other per-parse transient state (`utf8Codepoint`, `utf16Surrogate`, `minCodepoint`, `numDfa`, `strDfa`) in addition to rewinding the symbol stack. Adds a regression test for the reported callback misrouting.
Bench and DFA tests with `SIGSYS` failures are unrelated to this change; the parser lifecycle tests pass.
WeaselJsonParser_reset is documented to restore the parser to its
newly-created state, but reset() only rewound the symbol stack. The
inKey flag and transient DFA/codepoint state from the previous parse
leaked into the next parse, so a top-level string after a mid-key
reset was delivered via on_key_data instead of on_string_data.
Reset inKey to false and clear utf8Codepoint, utf16Surrogate,
minCodepoint, numDfa, and strDfa so the next document starts fresh.
Add a test that reproduces the reported misrouting.
weaselbot
marked the pull request as ready for review 2026-06-18 14:35:32 +00:00
andrew
merged commit 7c1c18fe6f into main2026-06-18 20:09:33 +00:00
andrew
deleted branch weaselbot/issue-22026-06-18 20:09:33 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #2
Ensures
WeaselJsonParser_resetrestores the parser to its newly-created state by clearinginKeyand other per-parse transient state (utf8Codepoint,utf16Surrogate,minCodepoint,numDfa,strDfa) in addition to rewinding the symbol stack. Adds a regression test for the reported callback misrouting.Bench and DFA tests with
SIGSYSfailures are unrelated to this change; the parser lifecycle tests pass.