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

Infinite loop in lexer when reading a string #20

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

xenon
Copy link
Contributor

@xenon xenon commented Feb 13, 2024

When read_string is called in the lexer with an input such as digraph { a -> b; " } it will never terminate. This is because the while loop in read_string does not take into account EOF occuring before the string is closed. I've changed the lexer so that this no longer occurs and added a test to confirm that it is fixed.

- Added a test to ensure unterminated strings are caught as an error by the lexer
Copy link
Owner

@nadavrot nadavrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Looks good to me.

@nadavrot nadavrot merged commit 08f2327 into nadavrot:master Feb 14, 2024
4 checks passed
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.

2 participants