Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixd/Parser: make parsing memory-safe for errors, using RAII #186

Merged
merged 2 commits into from Jun 29, 2023

Conversation

inclyc
Copy link
Member

@inclyc inclyc commented Jun 29, 2023

Free memory using a series of context object, record all allocated references, and free them automatically.

Previous implementation do require there are no syntax errors. But this one is not leaking for any errors.

@inclyc inclyc force-pushed the nixd/parser/RAII branch 2 times, most recently from a25e095 to d496dd3 Compare June 29, 2023 17:07
nixd/include/nixd/Parser/Require.h Outdated Show resolved Hide resolved
nixd/include/nixd/Parser/Prologue.h Outdated Show resolved Hide resolved
Base automatically changed from tool/nixd-ast-dump to main June 29, 2023 18:18
Free memory using a series of context object, record all allocated
references, and free them automatically.

Previous implementation do require there are no syntax errors. But this
one is not leaking for any errors.
@inclyc inclyc marked this pull request as ready for review June 29, 2023 18:26
@inclyc inclyc merged commit c4557ca into main Jun 29, 2023
28 checks passed
@inclyc inclyc deleted the nixd/parser/RAII branch June 29, 2023 18:51
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.

None yet

1 participant