Skip to content

SILGen: Fix ordering of key path application writebacks with other lvalue components. #18357

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
Jul 30, 2018

Conversation

jckarter
Copy link
Contributor

Leaving the owner pointer returned by the runtime function to get released at scope end was incorrect, since this would lead to writebacks accrued during key path traversal happening out of sequence with non-key-path components in the same formal access. Add them as "writebacks" to the formal evaluation scope so that they get destroyed in proper order relative to adjacent lvalue components, fixing SR-7695 | rdar://problem/40295854.

…alue components.

Leaving the owner pointer returned by the runtime function to get released at scope end was incorrect, since this would lead to writebacks accrued during key path traversal happening out of sequence with non-key-path components in the same formal access. Add them as "writebacks" to the formal evaluation scope so that they get destroyed in proper order relative to adjacent lvalue components, fixing SR-7695 | rdar://problem/40295854.
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter jckarter requested a review from gottesmm July 30, 2018 20:55
@jckarter
Copy link
Contributor Author

@gottesmm I cargo-culted the writeback hacking from AddressorComponent here; does this look OK?

@gottesmm
Copy link
Contributor

Question. If this was made non-local, I imagine we could use this instead of OwnedFormalAccess, no?

@jckarter
Copy link
Contributor Author

It doesn't look like we use OwnedFormalAccess as part of lvalue emission elsewhere.

@jckarter jckarter requested a review from rjmccall July 30, 2018 22:22
@rjmccall
Copy link
Contributor

rjmccall commented Jul 30, 2018

Yeah, I think this is the right approach for this, and the ordering of cleanups is fine for the specific case of these returned owner pointers.

@gottesmm
Copy link
Contributor

LGTM

@jckarter
Copy link
Contributor Author

Thanks!

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.

3 participants