Skip to content

[4.1] [Serialization] Handle XREFs to private types #14473

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

jrose-apple
Copy link
Contributor

  • Explanation: When the compiler modifies an inlinable function to break apart a struct, and the struct uses a private type for one of its fields, it's possible to end up with a reference to that type across module boundaries. This can happen even in compiler-synthesized code, which results in a regression from Swift 4.0.
  • Scope: Affects private types referenced directly or indirectly in inlinable code (including compiler-synthesized code)
  • Issue: SR-6874 / rdar://problem/37072260
  • Reviewed by: @DougGregor
  • Risk: Medium-low. The new code is only used in cases that didn't work before, but it's a little more than trivial.
  • Testing: Added compiler regression tests, verified that the original project builds

We can encounter these when the compiler modifies an inlinable
function to break apart a struct and the struct uses a private
type for one of its fields. It's questionable whether we /should/
handle this, but meanwhile this /is/ a non-intrusive fix that
preserves the performance of non-resilient libraries.

(That is, it appears this worked in Swift 4.0, though perhaps
not all of the same optimizations kicked in.)

https://bugs.swift.org/browse/SR-6874
(cherry picked from commit af67204)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please nominate

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