Skip to content

[Exclusivity] Statically enforce exclusive access in noescape closures #10310

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
Jun 17, 2017

Conversation

devincoughlin
Copy link
Contributor

Use the AccessSummaryAnalysis to statically enforce exclusive access for
noescape closures passed as arguments to functions.

We will now diagnose when a function is passed a noescape closure that begins
an access on capture when that same capture already has a conflicting access
in progress at the time the function is applied.

The interprocedural analysis is not yet stored-property sensitive (unlike the
intraprocedural analysis), so this will report violations on accesses to
separate stored properties of the same struct.

rdar://problem/32020710

@devincoughlin
Copy link
Contributor Author

@swift-ci Please smoke test and merge

@devincoughlin devincoughlin force-pushed the noescape-closure-land branch from 04a6e28 to cea375d Compare June 17, 2017 15:06
@devincoughlin
Copy link
Contributor Author

Updated to weaken an assertion and provide test cases that triggered the assertion.

@devincoughlin
Copy link
Contributor Author

@swift-ci Please test and merge

Use the AccessSummaryAnalysis to statically enforce exclusive access for
noescape closures passed as arguments to functions.

We will now diagnose when a function is passed a noescape closure that begins
an access on capture when that same capture already has a conflicting access
in progress at the time the function is applied.

The interprocedural analysis is not yet stored-property sensitive (unlike the
intraprocedural analysis), so this will report violations on accesses to
separate stored properties of the same struct.

rdar://problem/32020710
@devincoughlin devincoughlin force-pushed the noescape-closure-land branch from cea375d to c51fbb9 Compare June 17, 2017 16:45
@devincoughlin
Copy link
Contributor Author

Updated to add ValueMetatypeInst to the list of whitelisted instructions that currently use an address without an access marker. I also changed the llvm_unreachable for instructions not on this whitelist to an assert() since I am not convinced the whitelist is exhaustive.

@devincoughlin
Copy link
Contributor Author

@swift-ci Please test and merge

@devincoughlin
Copy link
Contributor Author

@swift-ci Please smoke test and merge

@devincoughlin devincoughlin merged commit 5ec0563 into swiftlang:master Jun 17, 2017
devincoughlin added a commit to devincoughlin/swift that referenced this pull request Jun 18, 2017
swiftlang#10310)

Use the AccessSummaryAnalysis to statically enforce exclusive access for
noescape closures passed as arguments to functions.

We will now diagnose when a function is passed a noescape closure that begins
an access on capture when that same capture already has a conflicting access
in progress at the time the function is applied.

The interprocedural analysis is not yet stored-property sensitive (unlike the
intraprocedural analysis), so this will report violations on accesses to
separate stored properties of the same struct.

rdar://problem/32020710
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.

1 participant