Skip to content
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

[4.0] SILGen: The allocator entry point for an initializer is never dynamic. #11108

Merged
merged 1 commit into from Jul 22, 2017

Conversation

jckarter
Copy link
Member

Explanation: We would miscompile required initializer in subclasses of Objective-C classes, causing an init message to be sent to the class object rather than an allocated instance of the object.

Scope: This was a latent bug in dynamic initializers, aggravated by our change to make all ObjC-compatible interfaces implicitly dynamic in order to ensure cross-language-version compatibility, making it a regression for existing code.

Issue: SR-5223 | rdar://problem/32778104.

Risk: Low, small bug fix.

Testing: Swift CI, compatibility suite, test case from Jira.

The allocating thunk handles the `dynamic`-ness of the initializing entry point, which maps to an underlying `-initWith*:` ObjC method, and cannot itself be treated as `dynamic`. Fixes SR-5223 | rdar://problem/32778104.

(cherry picked from commit e6b356a)
@jckarter
Copy link
Member Author

@slavapestov Mind reviewing this for 4.0?

@jckarter
Copy link
Member Author

@swift-ci Please test

@jckarter
Copy link
Member Author

@swift-ci Please test source compatibility

@jckarter jckarter merged commit 7c8958f into apple:swift-4.0-branch Jul 22, 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.

None yet

2 participants