Skip to content
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

interpret memory access hooks: also pass through the Pointer used for the access #138713

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

RalfJung
Copy link
Member

In some ongoing work on the Miri side, we need the absolute address that the memory access occurred at. That is non-trivial to obtain since we don't have an ecx. So pass through the Pointer used for the access, which contains the address, and which is available everywhere we are calling these hooks.

r? @oli-obk

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Mar 19, 2025

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@@ -413,6 +413,7 @@ pub trait Machine<'tcx>: Sized {
_tcx: TyCtxtAt<'tcx>,
_machine: &Self,
_alloc_extra: &Self::AllocExtra,
_ptr: Pointer<Option<Self::Provenance>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document that these pointers are always "the same" information as the prov argument, just before being taken apart

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

@oli-obk
Copy link
Contributor

oli-obk commented Mar 20, 2025

r=me with comment

@RalfJung RalfJung force-pushed the memory-hook-pointers branch from 72272d2 to b9f59f6 Compare March 20, 2025 16:00
@RalfJung
Copy link
Member Author

@bors r=oli-obk rollup

@bors
Copy link
Contributor

bors commented Mar 20, 2025

📌 Commit b9f59f6 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 20, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#137357 (Document results of non-positive logarithms)
 - rust-lang#138650 (Optimize `io::Write::write_fmt` for constant strings)
 - rust-lang#138694 (Fix: add ohos target notes)
 - rust-lang#138713 (interpret memory access hooks: also pass through the Pointer used for the access)
 - rust-lang#138724 (Check attrs: Don't try to retrieve the name of list stems)
 - rust-lang#138743 (bootstrap: add `--ci` flag)
 - rust-lang#138751 (Fix the "used_with_archive" test on Fuchsia)
 - rust-lang#138754 (Handle spans of `~const`, `const`  and `async` trait bounds in macro expansion)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7c1b128 into rust-lang:master Mar 21, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 21, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2025
Rollup merge of rust-lang#138713 - RalfJung:memory-hook-pointers, r=oli-obk

interpret memory access hooks: also pass through the Pointer used for the access

In some ongoing work on the Miri side, we need the absolute address that the memory access occurred at. That is non-trivial to obtain since we don't have an `ecx`. So pass through the `Pointer` used for the access, which contains the address, and which is available everywhere we are calling these hooks.

r? `@oli-obk`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants