Skip to content

Fix AccessEnforcementOpts; miscompile; incorrect address projection#88643

Open
atrick wants to merge 1 commit intoswiftlang:mainfrom
atrick:fix-enforce-access
Open

Fix AccessEnforcementOpts; miscompile; incorrect address projection#88643
atrick wants to merge 1 commit intoswiftlang:mainfrom
atrick:fix-enforce-access

Conversation

@atrick
Copy link
Copy Markdown
Contributor

@atrick atrick commented Apr 24, 2026

  • Explanation: Fixes AccessEnforcementOpts; miscompile; incorrect address projection. Add a bailout for an unexpected SIL pattern.

  • Scope: This only affects a SIL pattern that was not supposed to be possible. In this case it disables an optimization, which is almost certainly incorrect in that case.

  • Issues: rdar://175181392

  • Risk: Negligible

  • Testing: New unit test

  • Reviewers: TBD


Normally, access scopes for dynamic exclusivity enforcement are supposed to be
on the address that is the based of a formal access. When this is true, it's
possible to merge two accesses whenever that have the same base by blindly
replacing all uses. But, in some strange situation that seems to result from
optimization and inlining, we end up with dynamic access on a projection. Simply
recognize that case and bailout.

Add a bailout for an unexpected SIL pattern.

Normally, access scopes for dynamic exclusivity enforcement are supposed to be
on the address that is the based of a formal access. When this is true, it's
possible to merge two accesses whenever that have the same base by blindly
replacing all uses. But, in some strange situation that seems to result from
optimization and inlining, we end up with dynamic access on a projection. Simply
recognize that case and bailout.

Fixes rdar://175181392
@atrick atrick requested a review from a team as a code owner April 24, 2026 06:37
@atrick atrick requested a review from meg-gupta April 24, 2026 06:37
@atrick atrick enabled auto-merge April 24, 2026 06:37
@atrick
Copy link
Copy Markdown
Contributor Author

atrick commented Apr 24, 2026

@swift-ci test

@atrick atrick requested a review from tbkka April 24, 2026 06:38
Copy link
Copy Markdown
Contributor

@drexin drexin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@atrick
Copy link
Copy Markdown
Contributor Author

atrick commented Apr 24, 2026

@swift-ci test macOS

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