Skip to content

[4.2] SILGen: When transforming to AnyHashable materialize the value in a temporary #17929

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

Conversation

aschwaighofer
Copy link
Contributor

emitAnyHashable expects an address value.

Cherry-pick from #17928.

Explanation: When transforming values to AnyHashable we sometimes (e.g
tuples of strings) omit converting the value to an address type by
storing it to the stack leading to a compiler crash.
The fix is to store the value to the stack if it is not already
available as an in memory value.

Scope: Affects only conversions to AnyHashable. The code seems to stem
from 2016.

Risk: Low. Code is added that checks that the value expected by
emitAnyHashable is already in memory if it is not we store it to memory.

Testing: A Swift CI test was added.

rdar://40583597

…in a temporary

emitAnyHashable expects an address value.

Cherry-pick from swiftlang#17928.

Explanation: When transforming values to AnyHashable we sometimes (e.g
tuples of strings) omit converting the value to an address type by
storing it to the stack leading to a compiler crash.
The fix is to store the value to the stack if it is not already
available as an in memory value.

Scope: Affects only conversions to AnyHashable. The code seems to stem
from 2016.

Risk: Low. Code is added that checks that the value expected by
emitAnyHashable is already in memory if it is not we store it to memory.

Testing: A Swift CI test was added.

rdar://40583597
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@aschwaighofer
Copy link
Contributor Author

@jckarter Can you review this?

Copy link
Contributor

@jckarter jckarter left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please nominate

@aschwaighofer aschwaighofer merged commit d5fd738 into swiftlang:swift-4.2-branch Jul 13, 2018
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