-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
mir-interpret: add method to read wide strings from Memory #69326
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @RalfJung |
This comment has been minimized.
This comment has been minimized.
I have some implementation questions..
Thank you for reading 👍 |
If the conversion is for Windows only, consider https://doc.rust-lang.org/nightly/std/ffi/index.html#on-windows |
That is pretty odd, and why should that work? The users of these APIs have no idea how long the string is going to be. You used
There should be nothing about For in this PR, you only need to add on the rustc side whatever primitives are needed to implement All that business about actually interpreting this sequence of |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hint: before pushing, always do |
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.
Yeah this looks good. :)
Could you please squash the commits? No need to have 17 commits for this.^^
d5738c5
to
05f6482
Compare
Ah I had missed that force-push, GH doesn't send emails for those so in the future please let me know that this is ready for review again. :) @bors r+ rollup |
📌 Commit 05f6482 has been approved by |
🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened |
Rollup of 7 pull requests Successful merges: - #69120 (Don't give invalid suggestion on desugared span.) - #69326 (mir-interpret: add method to read wide strings from Memory) - #69608 (Expose target libdir information via print command) - #69734 (Change DIBuilderCreateEnumerator signature to match LLVM 9) - #69800 (Compile address sanitizer test with debuginfo) - #69807 (Cleanup E0391 explanation) - #69820 (clean up E0392 explanation) Failed merges: r? @ghost
Implemented step2 from instructions laid out in rust-lang/miri#707.
Added 2 new methods to struct
rustc_mir::interpret::InterpCx
.read_os_str_from_wide_str
(src/librustc_mir/interpret/operand.rs)write_os_str_to_wide_str
(src/librustc_mir/interpret/place.rs)These methods are intended to be used for environment variable emulation in Windows.