Skip to content

SIL: Fix zealous assert in verifier #14132

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

Conversation

aschwaighofer
Copy link
Contributor

A materialize for set / write-back sequence is not really mutating the opened existential

rdar://36799163

A materialize for set / write-back sequence is not really mutating the opened existential

rdar://36799163
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please smoke test and merge

@aschwaighofer
Copy link
Contributor Author

@jckarter Can you review for swift-4.1-branch?

@swift-ci swift-ci merged commit bd744a3 into swiftlang:master Jan 24, 2018
@aschwaighofer aschwaighofer removed the request for review from jckarter January 25, 2018 17:28
@aschwaighofer
Copy link
Contributor Author

@jckarter Andy reviewed it here #14134

@jckarter
Copy link
Contributor

This is fine for 4.1, but how hard is it to fix SILGen to generate the materializeForSet callback with the right parameter convention in master? Or does that not matter after @rjmccall lands accessor coroutines?

@aschwaighofer
Copy link
Contributor Author

I don't know. I have filed rdar://problem/36867783 for this (to fix SILGen).

@aschwaighofer
Copy link
Contributor Author

Do we even need to emit a write back in the case of a non-mutating set? Semantically -- at first thought -- it must be a identity operation on memory?
For symmetry, I guess the write-back thunk could be a no-op.

@rjmccall
Copy link
Contributor

A setter being nonmutating means that it doesn't change the value of self, not that it's guaranteed to semantically be a no-op. The most obvious examples are reference types like classes and UnsafeMutablePointer.

@aschwaighofer
Copy link
Contributor Author

right, so the write-back for a non-mutating set is a no-op on the memory of self. (that is what i meant by identity operation -- the value not being mutated in case of references or pointers is the reference or pointer)

@aschwaighofer
Copy link
Contributor Author

all the mutation on general heap memory happens as part of the materializeForSet operation not on the write back.

@rjmccall
Copy link
Contributor

There should not be a writeback on the base l-value, yes.

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.

4 participants