Skip to content

SILModule: track opened archetypes per function. #37036

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
Apr 23, 2021

Conversation

eeckstein
Copy link
Contributor

In theory we could map opened archetypes per module because opened archetypes should be unique across the module.
But currently in some rare cases SILGen re-uses the same opened archetype in multiple functions.
The fix is to add the SILFunction to the map's key.
That also requires that we update the map whenever instructions are moved from one function to another.

This fixes a compiler crash.

rdar://76916931

In theory we could map opened archetypes per module because opened archetypes _should_ be unique across the module.
But currently in some rare cases SILGen re-uses the same opened archetype in multiple functions.
The fix is to add the SILFunction to the map's key.
That also requires that we update the map whenever instructions are moved from one function to another.

This fixes a compiler crash.

rdar://76916931
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein merged commit 40b5aa0 into swiftlang:main Apr 23, 2021
@eeckstein eeckstein deleted the fix-open-archetype-mapping branch April 23, 2021 16:03
@slavapestov
Copy link
Contributor

Would it be better to fix SILGen instead? Is this only possible when we re-emit initializer expressions of pattern bindings multiple times?

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.

2 participants