Skip to content

[4.2] Runtime: Handle synthesized decl "related entity" tags. #17603

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

Merged

Conversation

jckarter
Copy link
Contributor

Explanation: Memory corruption would occur when attempting to reflect a Swift type that was synthesized by the Clang importer, such as NSError wrapper types.

Scope: Regression from Swift 4.1

Issue: rdar://problem/40878715

Risk: Low, additive change to the runtime to cover mangling cases that were dropped on the floor before.

Testing: Test case from Radar, Swift CI

Reviewed by: @DougGregor and @jrose-apple

jckarter added 2 commits June 28, 2018 12:26
Better to log the failure than fall off the edge of this function, which is expected to always invoke its callback once.
Clang-importer-synthesized declarations get an extra tag character included in their mangling, which was not being preserved in type context descriptors. This caused runtime lookup for these synthesized types to fail. Fix this by adding the tag information to type context descriptors and teaching the runtime to match it up when fetching metadata by mangled name. Fixes rdar://problem/40878715.
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter
Copy link
Contributor Author

@swift-ci Please nominate

@jckarter jckarter merged commit d13d600 into swiftlang:swift-4.2-branch Jun 28, 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.

1 participant