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

Better handle missing nodes in parsing #108

Open
PgBiel opened this issue Jan 26, 2025 · 1 comment
Open

Better handle missing nodes in parsing #108

PgBiel opened this issue Jan 26, 2025 · 1 comment

Comments

@PgBiel
Copy link
Contributor

PgBiel commented Jan 26, 2025

I've fixed one case where the macro name might be missing due to an error node in #103, but it seems there are many more cases where nodes can just disappear and cause a crash. I managed to trigger a crash on enum parsing as well (line 46) by typing some invalid enum syntax (don't have a minimal example at the moment). Perhaps we should just assume that most nodes can be missing instead of trying to access right away.

@pherrymason
Copy link
Owner

This is interesting. I've arruved to the conclusióon that code in the parser should be more defensive indeed, as as you say, some nodes can be missing and that would cause crashes.

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

No branches or pull requests

2 participants