Skip to content

Fix bugs found by mutating source in SwiftParserTest using alternative token choices #1341

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

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Feb 12, 2023

This is a collection of fixes for bugs that I found using the technique in #1340.

@ahoppen
Copy link
Member Author

ahoppen commented Feb 12, 2023

@swift-ci Please test

Comment on lines +1663 to +1665
DiagnosticSpec(locationMarker: "1️⃣", message: "expected value and ')' to end tuple"),
DiagnosticSpec(locationMarker: "2️⃣", message: #"unexpected code '"""' in string literal"#),
DiagnosticSpec(locationMarker: "3️⃣", message: #"expected '"""' to end string literal"#),
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels like the """ should be a strong marker that an interpolation is unterminated. But I'm all for this vs an infinite loop 😅.

@@ -1612,11 +1613,12 @@ extension Parser {
modifier = nil
}

let introducer = self.eat(handle)
Copy link
Contributor

Choose a reason for hiding this comment

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

Whoops!

@bnbarham
Copy link
Contributor

Most of these seem worth cherry-picking to 5.8 (the infinite loop ones at the very least).

@ahoppen ahoppen merged commit 02da1a1 into swiftlang:main Feb 14, 2023
@ahoppen ahoppen deleted the ahoppen/fixes-found-by-source-alteration branch February 14, 2023 10:00
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