Skip to content

parser: check too many layers embedded generic type (fix #22089) - #22091

Merged
spytheman merged 2 commits into
vlang:masterfrom
yuyi98:fix_parser_generic_init
Aug 22, 2024
Merged

spytheman merged 2 commits into
vlang:masterfrom
yuyi98:fix_parser_generic_init

Conversation

@yuyi98

@yuyi98 yuyi98 commented Aug 22, 2024

Copy link
Copy Markdown
Member

This PR check too many layers embedded generic type (fix #22089).

  • Check too many layers embedded generic type.
  • Add test.
Hello, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<
o, Wprld<

PS D:\Test\v\tt1> v run tt1.v
tt1.v:11:9: error: too many levels of Parser.parse_generic_inst_type() calls: 11, probably due to too many layers embedded generic type
    9 | o, Wprld<
   10 | o, Wprld<
   11 | o, Wprld<
      |         ^
   12 | o, Wprld<
   13 | o, Wprld<

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Excellent work.

@spytheman
spytheman merged commit 18f8999 into vlang:master Aug 22, 2024
@yuyi98
yuyi98 deleted the fix_parser_generic_init branch August 22, 2024 14:49
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.

parser panic for reaching eof too many times, discovered through radamsa

2 participants