Skip to content

Conversation

slavapestov
Copy link
Contributor

Previously we were only doing this in assert builds, or if the
new Objective-C runtime metadata update hook mechanism was
available.

However, swift_checkMetadataState() gets called on the superclass
of a class, and it assumes that the metadata entry for the
superclass already exists in the singleton cache.

So even on an older runtime when there's no initialization work
to be done, we have to realize the superclass to populate the
singleton cache so that the check can succeed.

Fixes rdar://problem/45569020.

…lassMetadata()

Previously we were only doing this in assert builds, or if the
new Objective-C runtime metadata update hook mechanism was
available.

However, swift_checkMetadataState() gets called on the superclass
of a class, and it assumes that the metadata entry for the
superclass already exists in the singleton cache.

So even on an older runtime when there's no initialization work
to be done, we have to realize the superclass to populate the
singleton cache so that the check can succeed.

Fixes <rdar://problem/45569020>.
@slavapestov
Copy link
Contributor Author

@swift-ci Please test macOS

@slavapestov slavapestov changed the title Runtime: Unconditionally realize superclass metadata in swift_updateClassMetadata() Runtime: Unconditionally realize superclass metadata in swift_updateClassMetadata() [5.0] Oct 27, 2018
@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 6afe8c1

@slavapestov
Copy link
Contributor Author

@swift-ci Please test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 6afe8c1

@slavapestov
Copy link
Contributor Author

@swift-ci Please test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 6afe8c1

@slavapestov
Copy link
Contributor Author

@swift-ci Please test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 6afe8c1

@dcci
Copy link
Member

dcci commented Oct 30, 2018

@swift-ci Please test macOS

@slavapestov slavapestov merged commit 136c821 into swiftlang:swift-5.0-branch Oct 30, 2018
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