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

Fix parser stuck in an error loop #62900

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

cdemirer
Copy link
Contributor

@cdemirer cdemirer commented Jul 11, 2022

Fixes (4.0) #53345

Using the repro from this comment #53345 (comment) because I couldn't reproduce it with the code in the initial comment.

When lambda functions were added to GDScript, the behavior of parse_precedence had to be changed to not consume a token if a valid prefix rule didn't exist.

advance(); // Only consume the token if there's a valid rule.

However, this can cause the parser to be stuck in an infinite loop in certain cases, since it never consumes the token causing the error.

With the assumption that this only happens with expression statements, I added an advance() call there, which will be called alongside the parser error.

Bugsquad edit: This closes #53345.

@cdemirer cdemirer requested a review from a team as a code owner July 11, 2022 00:22
@Calinou Calinou added this to the 4.0 milestone Jul 11, 2022
@vnen vnen merged commit d51aac1 into godotengine:master Jul 13, 2022
@vnen
Copy link
Member

vnen commented Jul 13, 2022

Thanks!

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

Successfully merging this pull request may close these issues.

One line of code generates hundreds of errors
3 participants