-
Notifications
You must be signed in to change notification settings - Fork 30
Basic support for checking raw pointer read/write #1462
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
base: main
Are you sure you want to change the base?
Conversation
|
@nilehmann ping -- I'd like to merge this one in to do more stuff on core. |
|
I'm looking at this now. |
|
@nilehmann I made the changes we discussed yesterday |
This comment was marked as resolved.
This comment was marked as resolved.
* Initial plan * Initial plan for addressing PR feedback Co-authored-by: nilehmann <[email protected]> * Address PR feedback: refactor symbols, inline function, remove unused variants Co-authored-by: nilehmann <[email protected]> * Properly use sym --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: nilehmann <[email protected]> Co-authored-by: Nico Lehmann <[email protected]>
nilehmann
left a comment
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.
@ranjitjhala some comments
| if matches!(mut_a, Mutability::Mut) { | ||
| self.tys(infcx, ty_b, ty_a)?; | ||
| } | ||
| Ok(()) |
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.
This makes me nervous. Did you add it because as_mut_ptr returns whatever refined type was in the input, and you wanted to keep using it the pointer at that type?
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.
Sort of -- I was just trying to mirror the story for &mut T here?
The option is to remove subtyping between raw-ptr, but that seemed to be worse, no?
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.
Or is your point that we IGNORE the refinements for stuff read through raw-ptr so it doesn't matter e.g.
https://github.com/flux-rs/flux/blob/9c27760a7bbbda9c95bceb21f831334bee11408e/crates/flux-refineck/src/checker.rs#L1403-L1404
Co-authored-by: Nico Lehmann <[email protected]>
|
@nilehmann I did the changes, except the ptr-subtyping, see discussion above. |
intindex with the pointer, to track how much is "valid" to write,e.g. the following now works, with an error reported without the preconditions.