-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Refactor miri pointer checks #62081
Merged
Merged
Refactor miri pointer checks #62081
Commits on Jun 23, 2019
-
Centralize bounds, alignment and NULL checking for memory accesses in…
… one function: memory.check_ptr_access That function also takes care of converting a Scalar to a Pointer, should that be needed. Not all accesses need that though: if the access has size 0, None is returned. Everyone accessing memory based on a Scalar should use this method to get the Pointer they need. All operations on the Allocation work on Pointer inputs and expect all the checks to have happened (and will ICE if the bounds are violated). The operations on Memory work on Scalar inputs and do the checks themselves. The only other public method to check pointers is memory.ptr_may_be_null, which is needed in a few places. With this, we can make all the other methods (tests for a pointer being in-bounds and checking alignment) private helper methods, used to implement the two public methods. That maks the public API surface much easier to use and harder to mis-use. While I am at it, this also removes the assumption that the vtable part of a `dyn Trait`-fat-pointer is a `Pointer` (as opposed to a pointer cast to an integer, stored as raw bits).
Configuration menu - View commit details
-
Copy full SHA for c50b9d1 - Browse repository at this point
Copy the full SHA c50b9d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for dcc8371 - Browse repository at this point
Copy the full SHA dcc8371View commit details -
clean up internals of pointer checks; make get_size_and_align also ch…
…eck for fn allocations
Configuration menu - View commit details
-
Copy full SHA for c12c8a7 - Browse repository at this point
Copy the full SHA c12c8a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c32ede - Browse repository at this point
Copy the full SHA 9c32edeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9492038 - Browse repository at this point
Copy the full SHA 9492038View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9954af4 - Browse repository at this point
Copy the full SHA 9954af4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38104ab - Browse repository at this point
Copy the full SHA 38104abView commit details
Commits on Jun 24, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 7e83028 - Browse repository at this point
Copy the full SHA 7e83028View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.