Skip to content

fix: when parser error, infinite loop in skipStatement (#1999) #2011

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

Merged
merged 1 commit into from
Sep 10, 2021

Conversation

HerrCai0907
Copy link
Member

@HerrCai0907 HerrCai0907 commented Jul 27, 2021

Fixes #1999, where in skipBlock(tn: Tokenizer): void, the condition of Token.TEMPLATELITERAL is missing and tn.next() also don't go to the next token. It causes infinite loop.

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@MaxGraey MaxGraey requested a review from dcodeIO July 27, 2021 16:47
@MaxGraey
Copy link
Member

MaxGraey commented Jul 29, 2021

Could you add tests for `p${1}`, `${2}n` please?

@HerrCai0907
Copy link
Member Author

Can this PR be merged? I have add some testcase for it.

@dcodeIO
Copy link
Member

dcodeIO commented Aug 13, 2021

I have been hesitant to merge because of a feeling that the { and } handling may modify depth in unexpected ways, potentially leading to a wall of red. Do the changes account for every possible { or } also inside of strings, or are there some that may still be missed? I think if all are covered then it should be fine.

@dcodeIO dcodeIO merged commit b1a5b0f into AssemblyScript:main Sep 10, 2021
@dcodeIO
Copy link
Member

dcodeIO commented Sep 10, 2021

Thanks :)

@HerrCai0907 HerrCai0907 deleted the issue-1999 branch September 26, 2021 23:37
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.

Small code makes parser hang
3 participants