interpret: fix after_local_read handling - #161646
Conversation
|
Some changes occurred to the CTFE machinery
cc @rust-lang/miri Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri |
|
r? @mu001999 rustbot has assigned @mu001999. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@rustbot reroll |
This comment has been minimized.
This comment has been minimized.
5f365e7 to
ed5a3c9
Compare
ed5a3c9 to
9a4f00e
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
9a4f00e to
1071f50
Compare
|
Since Oli is on vacation This turned now into a bit of a refactor of how we handle "not-real accesses". |
5e9a5e2 to
531e812
Compare
|
@bors r+ |
interpret: fix after_local_read handling `after_local_read` handling was wrong in two ways: - Contrary to what was documented, we invoked it for all reads of locals, not just reads of locals that have their values stored as immediates (without memory). - Miri effectively ignored the `frame` we are passing to it. And indeed we never want this called on anything but the current frame, also for consistency with the corresponding write hook. So let's restrict `local_to_op` to the current frame. Debuggers/visualizers should be able to use the existing method on `LocalState` that Miri also needs for its provenance visitor. Its name was not sufficiently scary for skipping access hooks, so I also overhauled how we name these "fake"/"ghost" access related APIs.
Rollup of 9 pull requests Successful merges: - #160533 (dirfd dir operations (3/4)) - #161294 (add crashtests [6/N]) - #160392 (library: motor: bump moto-rt ABI ver to 17) - #161646 (interpret: fix after_local_read handling) - #160819 (Rework `div_ceil` for nonzero integers) - #161591 (run `classify-runtime-const` test for `f128`) - #161680 (renovate: add lockfile update warning) - #161702 (Use `drop_guard` in some places in {core,alloc,std}) - #161709 (Stop rustfmt deleting attributes in fn params)
…uwer Rollup of 10 pull requests Successful merges: - #160533 (dirfd dir operations (3/4)) - #161294 (add crashtests [6/N]) - #160392 (library: motor: bump moto-rt ABI ver to 17) - #161646 (interpret: fix after_local_read handling) - #161682 (Update books) - #160819 (Rework `div_ceil` for nonzero integers) - #161204 (core: Make funnel shifts panic only if overflow checks are enabled) - #161591 (run `classify-runtime-const` test for `f128`) - #161680 (renovate: add lockfile update warning) - #161709 (Stop rustfmt deleting attributes in fn params)
Rollup merge of #161646 - RalfJung:after_local_read, r=saethlin interpret: fix after_local_read handling `after_local_read` handling was wrong in two ways: - Contrary to what was documented, we invoked it for all reads of locals, not just reads of locals that have their values stored as immediates (without memory). - Miri effectively ignored the `frame` we are passing to it. And indeed we never want this called on anything but the current frame, also for consistency with the corresponding write hook. So let's restrict `local_to_op` to the current frame. Debuggers/visualizers should be able to use the existing method on `LocalState` that Miri also needs for its provenance visitor. Its name was not sufficiently scary for skipping access hooks, so I also overhauled how we name these "fake"/"ghost" access related APIs.
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#160533 (dirfd dir operations (3/4)) - rust-lang/rust#161294 (add crashtests [6/N]) - rust-lang/rust#160392 (library: motor: bump moto-rt ABI ver to 17) - rust-lang/rust#161646 (interpret: fix after_local_read handling) - rust-lang/rust#161682 (Update books) - rust-lang/rust#160819 (Rework `div_ceil` for nonzero integers) - rust-lang/rust#161204 (core: Make funnel shifts panic only if overflow checks are enabled) - rust-lang/rust#161591 (run `classify-runtime-const` test for `f128`) - rust-lang/rust#161680 (renovate: add lockfile update warning) - rust-lang/rust#161709 (Stop rustfmt deleting attributes in fn params)
after_local_readhandling was wrong in two ways:framewe are passing to it. And indeed we never want this called on anything but the current frame, also for consistency with the corresponding write hook.So let's restrict
local_to_opto the current frame.Debuggers/visualizers should be able to use the existing method on
LocalStatethat Miri also needs for its provenance visitor. Its name was not sufficiently scary for skipping access hooks, so I also overhauled how we name these "fake"/"ghost" access related APIs.