Skip to content

[arc] An apply of a callee_guaranteed thick function is a "guaranteed… #14832

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

gottesmm
Copy link
Contributor

… use" of the function.

rdar://37820485
(cherry picked from commit 4941fba)

… use" of the function.

rdar://37820485
(cherry picked from commit 4941fba)
@gottesmm
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c8567cf

@gottesmm
Copy link
Contributor Author

The linux failure is due to git issue on the servers. Running again.

@gottesmm
Copy link
Contributor Author

@swift-ci test linux platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c8567cf

@gottesmm
Copy link
Contributor Author

@swift-ci test linux platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c8567cf

@gottesmm
Copy link
Contributor Author

This passed testing, but the smoke test label builder didn't trigger appropriately.

Copy link
Contributor

@aschwaighofer aschwaighofer left a comment

Choose a reason for hiding this comment

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

LGTM

@gottesmm
Copy link
Contributor Author

Explanation: When callee_guaranteed was enabled, the ARC optimizer was not taught that applying a callee_guaranteed thick function is a guaranteed use of the thick function. This PR fixes said issue.
Scope: This is an important change since not treating callee_guaranteed thick functions as guaranteed uses breaks ARC semantics and can cause use-after-free memory errors to occur.
Radar/SR Issue: SR-7064, rdar://37820485
Risk: Minimal. This is a small change that fixes an important correctness issue.
Testing: I wrote tests that test the specific pass in question and made sure that the behavior no longer showed up. I also ran the test app from SR-7064 with a modified compiler and verified that the app no longer crashes under guard malloc.
Reviewer: @aschwaighofer

@gottesmm
Copy link
Contributor Author

@swift-ci test linux platform

@eeckstein eeckstein merged commit 6d0629e into swiftlang:swift-4.1-branch Feb 27, 2018
@gottesmm gottesmm deleted the swift-4.1-branchrdar37820485 branch February 27, 2018 17:33
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.

4 participants