Skip to content

Serialization: Fix crash when deserializing store_unowned SIL instruction [4.1] #13419

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

slavapestov
Copy link
Contributor

  • Description: We would crash in deserialization when deserializing the store_unowned instruction.

  • Scope of the issue: Now that we preserve SIL when merging modules, there are more ways to trigger this in normal code, but in Swift 4.0 you could hit this by an @inline(__always) function that assigned to an unowned property.

  • Origination: Bug was present in the original implementation of "new" unowned properties that was added to Swift 3.0.

  • Risk: Very low, it's a trivial fix.

  • Tested: New test case added.

  • Radar: rdar://problem/35980211.

  • Reviewed by: @jckarter

…tion

We were casting the operand type to a WeakStorageType when in fact
it is an UnownedStorageType.

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

@swift-ci Please test

Copy link
Contributor

@jckarter jckarter left a comment

Choose a reason for hiding this comment

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

Looks good.

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

LGTM.

@ematejska ematejska merged commit 2199152 into swiftlang:swift-4.1-branch Dec 14, 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.

4 participants