Skip to content

Forcibly disable static constant array emission for now #61830

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
merged 1 commit into from
Nov 1, 2022

Conversation

tbkka
Copy link
Contributor

@tbkka tbkka commented Oct 31, 2022

This code currently uses the "empty array" metadata for static arrays (because the "empty array" can never be freed and the metadata on the array storage is not actually used in Swift).

But that doesn't work if the array is passed to Objective-C, which does rely on the metadata. So Objective-C code would see bridged arrays of this type as empty.

Workaround for: rdar://101126543 and rdar://100480289

This code currently uses the "empty array" metadata for static arrays (because
the "empty array" can never be freed and the metadata on the array storage is
not actually used in Swift).

But that doesn't work if the array is passed to Objective-C,
which does rely on the metadata.  So Objective-C code would
see bridged arrays of this type as empty.

Workaround for: rdar://101126543
@tbkka
Copy link
Contributor Author

tbkka commented Oct 31, 2022

@swift-ci Please test

@tbkka
Copy link
Contributor Author

tbkka commented Nov 1, 2022

@swift-ci Please test macOS platform

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

Lgtm

@tbkka
Copy link
Contributor Author

tbkka commented Nov 1, 2022

@swift-ci Please test macOS platform

@tbkka tbkka merged commit 9a9cfab into swiftlang:main Nov 1, 2022
eeckstein added a commit to eeckstein/swift that referenced this pull request Nov 2, 2022
meg-gupta pushed a commit to meg-gupta/swift that referenced this pull request Nov 9, 2022
@tbkka tbkka deleted the tbkka-disable-static-array-generation branch August 1, 2024 16:37
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