Skip to content

[SyntaxParse] Fix crashers for generic parameter with attributes #27544

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
Oct 8, 2019

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Oct 4, 2019

It used to crash for:
Attribute without its name (e.g. Foo<@>)
Missing name with attributes (e.g. Foo<@available(*, unavailable)>

  • Synthesize identifier token so that the SyntaxParsingContext can successfully construct the Attribute syntax.
  • Don't throw away the parsed attributes if the parameter name is missing. Instead, construct GenericParamater syntax anyway, and handle it in ASTGen.

It used to crash for:
Attribute without its name (e.g. Foo<@>)
Missing name with attributes (e.g. Foo<@available(*, unavailable)>

- Synthesize identifier token so that the SyntaxParsingContext can
  successfully construct the Attribute syntax.
- Don't throw away the parsed attributes if the parameter name is
  missing. Instead, construct GenericParamater syntax anyway, and handle
  it in ASTGen.
@rintaro rintaro requested a review from nathawes October 4, 2019 18:09
@rintaro
Copy link
Member Author

rintaro commented Oct 7, 2019

@swift-ci Please smoke test

@rintaro rintaro merged commit 071a713 into swiftlang:master Oct 8, 2019
@rintaro rintaro deleted the syntaxparse-attrincomplete branch October 8, 2019 00:33
rintaro added a commit to rintaro/swift that referenced this pull request Oct 14, 2019
…ttrincomplete"

This reverts commit 071a713, reversing
changes made to dbddb0d.
rintaro added a commit to rintaro/swift that referenced this pull request Oct 14, 2019
…xparse-attrincomplete""

This reverts commit 6f4dc25.
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