Skip to content

[5.0][Sema] Add defensive guard for implicit use of self in closure check #22912

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Feb 26, 2019

(Cherry-pick of #22908 for swift-5.0-brach)

  • Explanation: We see several crashes the isImplicitSelfUse(). This change adds defensive check for null Type to avoid crashing in release build. This function is for diagnosing implicit self usage in closure. If the expression doesn't have Type here, it should have been diagnosed somewhere else. So in that case, we can skip the check.
  • Scope: Implicit self usages in closure.
  • Issue: rdar://problem/47895109
  • Risk: Very low. This change just add a defensive check in safe manner.
  • Testing: Passes all unit tests. Since I haven't been able to find a reproducer for the crash. There's no test cases added.
  • Reviewer: Argyrios Kyrtzidis (@akyrtzi)

rdar://problem/47895109

Add assetion along with defensive guard to avoid crashing in release
build. Hopefully, sourcekitd Stress Tester find a reproducer for the
crash.

rdar://problem/47895109
(cherry picked from commit ce30a72)
@rintaro rintaro requested a review from a team as a code owner February 26, 2019 02:06
@rintaro
Copy link
Member Author

rintaro commented Feb 26, 2019

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Feb 26, 2019

@swift-ci Please nominate

@akyrtzi akyrtzi merged commit fa5d493 into swiftlang:swift-5.0-branch Feb 26, 2019
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