Skip to content

Conversation

trentxintong
Copy link
Contributor

@trentxintong trentxintong commented Sep 6, 2016

––– CCC Information –––
• Explanation: It is a possible compiler crash fix when LLVM ARC tries to get initializer for globals that are external.
• Scope of Issue: It can happen when we call getInitializer() for globals that are external in LLVM ARC pass.
• Origination: Long standing bug for multiple years. rdar://problem/27941015
• Risk: very low.
• Reviewed By: Erik Eckstein
• Testing: Verified locally and using a CI @please smoke test
• Directions for QA: No special directions. The patch includes unit tests.

Detailed description:

We tried to call getInitializer() for globals that are external. we are missing a check. Using the hasDefinitiveInitializer() is the right way to do this check, it guarantees that we have an initializer for the metatype information and its definitive and unique. With this information, we can analyze the destructor and reason about whether its safe to delete an allocation.

Fixes rdar://problem/27941015

@trentxintong
Copy link
Contributor Author

@swift-ci Please test

@trentxintong trentxintong merged commit 16dd310 into swiftlang:swift-3.0-branch Sep 6, 2016
@trentxintong trentxintong deleted the LLVMARC branch September 16, 2016 05:09
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.

1 participant