-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Always allow field access for objects defined inside a recover block #3606
Always allow field access for objects defined inside a recover block #3606
Conversation
That's why I never opened this, I didn't rigorously test deep field accesses: they won't work in all cases with this. |
May need to add/remove/merge unit tests still to ensure the right behavior is covered, but this is set to review. |
Windows CI is failing because of one variable which is used in a single case branch, complaining that it's not initialized elsewhere, which is technically true, but missing the point. I'll fix it, but remain quite disgruntled about it as it makes the code harder to read for everyone & and the compiler, imo. |
I don't know this code at all. I'm leaving this in @jemc's hands as I consider him the "domain expert". |
@jasoncarr0 can you rebase this against master? |
56173ad
to
96deb45
Compare
I've reverted the component about field accesses for another day (I still believe it's an important/sound addition) and likely an RFC. Accessing local fields is an important fix to get in as it's very cumbersome but always possible to work around (hence no soundness changes). I've also improved the log messages to be somewhat clearer. |
An expression all of whose variables are from the recover block itself, is always valid. In this case this is only checking deep field access by recursing to the left
So long as the thing to write is sendable, it can be safely removed from the isolated region of the recover block, just like for an iso object.
…ity is met." This reverts commit dde7b9f.
4e32d6a
to
eb5e32a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just one naming suggestion:
Co-authored-by: Joe Eli McIlvain <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to merge once the CI runs come back green.
For a moment I was excited at how easy the suggestions feature made it and then I realized I still needed to change the callsite 😅 |
@jasoncarr0 can you add public facing release notes to #3605 for this? |
I should have opened this ages ago, but this change always allows simple assignments with variables defined locally:
x.y = e
,x.y.z.q = e
Soundness can be seen because this functionality is possible today using methods, it is just very cumbersome.
This also includes a change to enable field-writes to non-local variables when the destination is sendable (this is slightly less than the most general: which would include writing a sendable expression to any field; but that requires adding more check logic). The current checks had very strange logic, and don't seem to be necessary: We only need to maintain isolation of the recover region, so it's perfectly fine to move sendable items in or out without restriction, since they cannot violate the guarantees. See #1057 for context of those original changes.
Fixes #3069