Skip to content

Conversation

eeckstein
Copy link
Contributor

Although a let-field can never be mutated, a release or consume of the class must be considered as writing to such a field.

This change removes the special handling of let-fields in two places, where they don't belong.
Class fields were handled by ImmutableScope anyway. I added handling of global let-variable in ImmutableScope, too.

Fixes a miscompile.
rdar://142996449

…s on it's let-fields

Although a let-field can never be mutated, a release or consume of the class must be considered as writing to such a field.

This change removes the special handling of let-fields in two places, where they don't belong.
Class fields are handled by ImmutableScope anyway.
Handling of global let-variable is temporarily removed by this commit.

Fixes a miscompile.
rdar://142996449
Global let-variables are immutable, except in functions which initialize them.
This brings back handling of global let-variables in alias analysis, which was removed in the previous commit.
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci apple silicon benchmark

@eeckstein eeckstein requested review from atrick and meg-gupta January 20, 2025 08:19
@eeckstein
Copy link
Contributor Author

@swift-ci test macos

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test macos

Copy link
Contributor

@meg-gupta meg-gupta left a comment

Choose a reason for hiding this comment

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

LGTM

@eeckstein eeckstein merged commit 2e92644 into swiftlang:main Jan 21, 2025
5 of 6 checks passed
@eeckstein eeckstein deleted the fix-alias-analysis branch January 21, 2025 20:11
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