Skip to content

[5.2] IRGen: don't create ObjC methods with the unnamed_addr attribute #29229

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

eeckstein
Copy link
Contributor

@eeckstein eeckstein commented Jan 15, 2020

This is a cherry-pick of #29188.

  • Explanation: In some places, Foundation is comparing ObjC method pointers.
    Therefore LLVM's function merging pass must not create aliases for identical functions, but instead create thunks. This can be ensured by not creating ObjC methods with the unnamed_addr attribute.
  • Scope: It problem causes an exception when using NSKeyedArchiver.archivedData. But there might be more places in Foundation where it is a problem.
  • Risk: Low
  • Issue: rdar://problem/58483698
  • Testing: with a regression test
  • Reviewer: @aschwaighofer

In some places, Foundation is comparing ObjC method pointers.
Therefore LLVM's function merging pass must not create aliases for identica; functions, but instead create thunks.
This can be ensured by not creating ObjC methods with the unnamed_addr attribute.

rdar://problem/58483698
@eeckstein eeckstein requested a review from a team as a code owner January 15, 2020 19:11
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci Please nominate

@tkremenek tkremenek merged commit 7c02102 into swiftlang:swift-5.2-branch Jan 24, 2020
@eeckstein eeckstein deleted the fix-unnamed-addr-5.2 branch January 24, 2020 07:45
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