-
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
Deprecate Read::initializer in favor of ptr::freeze #58363
Closed
Closed
Commits on Feb 10, 2019
-
Deprecate Read::initializer in favor of ptr::freeze
Read implementations should only write into the buffer passed to them, but have the ability to read from it. Access of uninitialized memory can easily cause UB, so there's then a question of what a user of a reader should do to initialize buffers. Previously, we allowed a Read implementation to promise it wouldn't look at the contents of the buffer, which allows the user to pass uninitialized memory to it. Instead, this PR adds a method to "freeze" undefined bytes into arbitrary-but-defined bytes. This is currently done via an inline assembly directive noting the address as an output, so LLVM no longer knows it's uninitialized. There is a proposed "freeze" operation in LLVM itself that would do this directly, but it hasn't been fully implemented. Some targets don't support inline assembly, so there we instead pass the pointer to an extern "C" function, which is similarly opaque to LLVM. The current approach is very low level. If we stabilize, we'll probably want to add something like `slice.freeze()` to make this easier to use.
Configuration menu - View commit details
-
Copy full SHA for 5e0fb23 - Browse repository at this point
Copy the full SHA 5e0fb23View commit details
Commits on Feb 11, 2019
-
Co-Authored-By: sfackler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c21e79e - Browse repository at this point
Copy the full SHA c21e79eView commit details -
Configuration menu - View commit details
-
Copy full SHA for e4d316e - Browse repository at this point
Copy the full SHA e4d316eView commit details
Commits on Feb 13, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 73133ee - Browse repository at this point
Copy the full SHA 73133eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1671e90 - Browse repository at this point
Copy the full SHA 1671e90View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0529921 - Browse repository at this point
Copy the full SHA 0529921View commit details -
Co-Authored-By: sfackler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 695feb1 - Browse repository at this point
Copy the full SHA 695feb1View commit details -
Co-Authored-By: sfackler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9d4f07e - Browse repository at this point
Copy the full SHA 9d4f07eView commit details
Commits on Feb 14, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 055bcb6 - Browse repository at this point
Copy the full SHA 055bcb6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 78e2233 - Browse repository at this point
Copy the full SHA 78e2233View commit details -
Update src/libcore/intrinsics.rs
Co-Authored-By: sfackler <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ec682d1 - Browse repository at this point
Copy the full SHA ec682d1View 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.