Skip to content

[embedded] Fix compiler asserts when building closures #68564

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
Sep 18, 2023

Conversation

kubamracek
Copy link
Contributor

See the added testcase, which previously triggered an assert. Two fixes:

  • Improve detection of generic functions, just checking the SubstGenericSignature is flagging @substituted functions as generic even if they're specialized.
  • Don't flag lazy emission of functions with external visibility because in embedded Swift, those can be gain public / externally-visible functions by deserializing them from imported modules, or by the CMO pass making local functions public. This is a workaround and not a real fix, it should probably be handled by some SIL pass that internalizes functions.

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek kubamracek added the embedded Embedded Swift label Sep 16, 2023
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

@kubamracek kubamracek merged commit 26653a7 into swiftlang:main Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedded Embedded Swift
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants