Skip to content

Add a SIL pass to select an access enforcement for allocated boxes. #8686

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

rjmccall
Copy link
Contributor

Tests to come.

@rjmccall
Copy link
Contributor Author

@swift-ci Please smoke test and merge.

@swift-ci swift-ci merged commit 6956926 into swiftlang:master Apr 11, 2017
@rjmccall rjmccall deleted the access-enforcement-selection-pass branch April 11, 2017 07:50
return setDynamicEnforcement(access);

// Otherwise, if there are no end_access instructions,
// check the terminators of every reachable block.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what "check the terminators" means" This code just checks if there are any uses reachable from this begin_access.

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

Nice, but this isn't quite what I expected:

There's extra complexity to handle begin_access markers that are not well-formed (no end_acces). What's that about, and how do you expect the SIL verifier to deal with it?

I actually expected most of the complexity to be in dealing with alloc_stack objects that escape via @inout_aliasable. It seems like you just assume those are statically verifiable. How do we know the noescape closure never causes simultaneous access to the captured variable?

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.

3 participants