Skip to content

Keep wrapped parser buffers local to each parse - #366

Open
Aschenbath wants to merge 1 commit into
keichi:masterfrom
Aschenbath:fix/oss-20-next-20261125-77d1-binary-wrapper-local
Open

Aschenbath wants to merge 1 commit into
keichi:masterfrom
Aschenbath:fix/oss-20-next-20261125-77d1-binary-wrapper-local

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Parsing a wrapped field currently assigns its temporary buffer without declaring a variable. Successful parses and failing wrappers therefore expose the input bytes through a global property and keep that buffer reachable after the call ends.

Declare the wrapped buffer inside the generated parser function. Six regressions check global isolation across fixed-length, EOF and predicate boundaries, repeated parses and thrown wrapper errors; all six fail on the original implementation.

Validation with the committed lockfile on Node 26.13.1 / Windows: 262 Node tests and 133 Chromium tests pass, with one existing browser skip. TypeScript build, type-aware lint and formatting checks pass. Independent controls cover nested wrappers, later wrapper calls and an existing read-only global property.

Prepared and validated with assistance from OpenAI Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant