Skip to content

Fix a miscompile in existential specialization during SILCombine. #41344

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
Feb 12, 2022

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Feb 11, 2022

The transformation propagations stack-initialized values. It checks
for any writes to the stack before doing so. OpenExistial instructions
now have a mutable property, so that also needs to be checked.

Add OpenExistentialAddrInst::isRead(SILInstruction).

Replace an isa<OpenExistentialAddrInst>(user) check with
`OpenExistentialAddrInst::isRead(user).

Fixes rdar://88664423 (SR-15791: Miscompile under -O with mutating protocol method)

The transformation propagations stack-initialized values. It checks
for any writes to the stack before doing so. OpenExistial instructions
now have a mutable property, so that also needs to be checked.

Add OpenExistentialAddrInst::isRead(SILInstruction).

Replace an `isa<OpenExistentialAddrInst>(user)` check with
`OpenExistentialAddrInst::isRead(user).

Fixes rdar://88664423 (SR-15791: Miscompile under -O with mutating protocol method)
@atrick
Copy link
Contributor Author

atrick commented Feb 11, 2022

@swift-ci test

@atrick
Copy link
Contributor Author

atrick commented Feb 11, 2022

@swift-ci test source compatibility

Copy link
Contributor

@aschwaighofer aschwaighofer left a comment

Choose a reason for hiding this comment

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

lgtm

@atrick atrick merged commit c67b72b into swiftlang:main Feb 12, 2022
@atrick atrick deleted the fix-open-existential branch February 12, 2022 06:09
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