Skip to content

[Exclusivity] Disable dynamic enforcement in noescape closures. #9479

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 4 commits into from
May 11, 2017
Merged

[Exclusivity] Disable dynamic enforcement in noescape closures. #9479

merged 4 commits into from
May 11, 2017

Conversation

atrick
Copy link
Contributor

@atrick atrick commented May 10, 2017


CCC

Explanation: Fully checking the exclusivity model requires enabling dynamic checks. We can't allow false positives, especially in a common case like mutation with a noescape closure. Instead we claim that these checks are currently incomplete for accesses within noescape closure. In the near future, once the lagnuage proposal is fully accepted, we will implement static checking of noescape closures. Static checking these cases is far superior for many reasons in addition to avoiding false positives.

Scope: Only affects -enforce-exclusivity=checked, which is purely opt-in.

Radar: rdar://problem/32119357 [Exclusivity] Disable dynamic enforcement in noescape closures.

Risk: Some code that violates the exclusivity model will pass without failure until static enforcement is enabled. This engenders a false sense of security.

Testing: All applications that have already been tested with enforcement need to be retested.

@atrick
Copy link
Contributor Author

atrick commented May 10, 2017

I'll revise this PR with comment typo fixes once this is merged on master:
#9482

@atrick
Copy link
Contributor Author

atrick commented May 10, 2017

@devincoughlin Would you review for CCC for inclusion into swift-4.0-branch?

@atrick atrick requested a review from devincoughlin May 10, 2017 23:43
@devincoughlin
Copy link
Contributor

This looks good to me!

(cherry picked from commit c76269c)
@atrick
Copy link
Contributor Author

atrick commented May 11, 2017

@swift-ci test and merge.

@atrick atrick merged commit db28f41 into swiftlang:swift-4.0-branch May 11, 2017
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