Skip to content

[4.0] SILGen: The foreign-to-native thunk for an @objc protocol member should use a native convention. #9445

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

jckarter
Copy link
Contributor

@jckarter jckarter commented May 9, 2017

Explanation: Referencing an ObjC protocol member as a function value would cause a miscompile due to mishandling of the thunk mapping the method to the Swift function value convention.

Scope: Anyone trying to use ObjC protocol members as function values would experience compiler crashes.

Issue: rdar://problem/31922123

Risk: Low.

Testing: Swift CI, test cases from Radar

@jckarter
Copy link
Contributor Author

jckarter commented May 9, 2017

@swift-ci Please test

@jckarter
Copy link
Contributor Author

jckarter commented May 9, 2017

@slavapestov This look OK for the 4.0 branch?

@jckarter jckarter requested a review from slavapestov May 9, 2017 23:32
@jckarter jckarter changed the title SILGen: The foreign-to-native thunk for an @objc protocol member should use a native convention. [4.0] SILGen: The foreign-to-native thunk for an @objc protocol member should use a native convention. May 9, 2017
@jckarter jckarter force-pushed the objc-protocol-foreign-to-native-thunk-4.0 branch from 929255f to e5cd262 Compare May 10, 2017 03:11
…ld use a native convention.

Fixes rdar://problem/31922123.
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter jckarter force-pushed the objc-protocol-foreign-to-native-thunk-4.0 branch from e5cd262 to 3fdf0b2 Compare May 10, 2017 03:22
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor

LGTM!

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - e5cd262c15f3985336cb68901c5a8781c7ac4e6e
Test requested by - @jckarter

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - e5cd262c15f3985336cb68901c5a8781c7ac4e6e
Test requested by - @jckarter

@jckarter jckarter merged commit 154e07c into swiftlang:swift-4.0-branch May 10, 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.

3 participants