interpret/allocation: get_range on ProvenanceMap#145540
interpret/allocation: get_range on ProvenanceMap#145540bors merged 1 commit intorust-lang:masterfrom
Conversation
|
rustbot has assigned @matthewjasper. Use |
| cx: &impl HasDataLayout, | ||
| range: AllocRange, | ||
| ) -> impl Iterator<Item = (Size, Prov)> { | ||
| let ptr_provs = self.range_ptrs_get(range, cx).to_owned(); |
There was a problem hiding this comment.
Why are you calling to_owned here?
There was a problem hiding this comment.
Fair, .iter().copied() would have been better I think but either way it's unnecessary if this doesn't return the offset per your other suggestion
| &self, | ||
| cx: &impl HasDataLayout, | ||
| range: AllocRange, | ||
| ) -> impl Iterator<Item = (Size, Prov)> { |
There was a problem hiding this comment.
There's no point in including the offset since one cannot even know whether that's a 1-byte provenance or a whole-ptr provenance. So either drop the Size, or add an Option<u8> carrying that information.
| } | ||
|
|
||
| /// Gets the provenances of all bytes (including from pointers) in a range. | ||
| pub fn get_range( |
There was a problem hiding this comment.
Please move this up so it is next to get_byte.
| cx: &impl HasDataLayout, | ||
| range: AllocRange, | ||
| ) -> impl Iterator<Item = Prov> { | ||
| let ptr_provs = self.range_ptrs_get(range, cx).iter().map(|(_, p)| *p); |
There was a problem hiding this comment.
This is the wrong range. You have to use adjusted_range_ptrs.
There was a problem hiding this comment.
Doesn't adjusted_range_ptrs only give us the offsets and not provenances? range_ptrs_get uses that internally anyways
There was a problem hiding this comment.
Ah, d'oh, right...
I shouldn't review when I am too tired.^^
|
☔ The latest upstream changes (presumably #145647) made this pull request unmergeable. Please resolve the merge conflicts. |
|
This PR was rebased onto a different master 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. |
|
Please squash then we can land this. |
|
Great! Since you think it's fine, r? RalfJung |
|
@bors r+ rollup |
interpret/allocation: get_range on ProvenanceMap Helper method to grab all provenances in a given address range for an allocation, making some logic in Miri nicer.
Rollup of 7 pull requests Successful merges: - #144452 (std/sys/fd: Relax `READ_LIMIT` on Darwin) - #145307 (Fix `LazyLock` poison panic message) - #145515 (Optimize `char::encode_utf8`) - #145540 (interpret/allocation: get_range on ProvenanceMap) - #145774 (Remove default opts from config) - #145780 (Do not warn about missing change ID in tarball builds) - #145781 (Remove profile section from Clippy) r? `@ghost` `@rustbot` modify labels: rollup
interpret/allocation: get_range on ProvenanceMap Helper method to grab all provenances in a given address range for an allocation, making some logic in Miri nicer.
interpret/allocation: get_range on ProvenanceMap Helper method to grab all provenances in a given address range for an allocation, making some logic in Miri nicer.
Rollup of 14 pull requests Successful merges: - #143898 (opt-dist: rebuild rustc when doing static LLVM builds) - #144452 (std/sys/fd: Relax `READ_LIMIT` on Darwin) - #145234 (match exhaustiveness diagnostics: show a trailing comma on singleton tuple consructors in witness patterns (and clean up a little)) - #145515 (Optimize `char::encode_utf8`) - #145540 (interpret/allocation: get_range on ProvenanceMap) - #145670 (port `sanitize` attribute to the new parsing infrastructure) - #145713 (next-solver: fix `feature(const_trait_impl)` bootstrap) - #145729 (Remove two duplicated crates) - #145744 (miri: also detect aliasing of in-place argument and return place) - #145774 (Remove default opts from config) - #145781 (Remove profile section from Clippy) - #145782 (rustdoc: make attributes render consistently) - #145787 (citool: cleanup `mismatched_lifetime_syntaxes` warnings) - #145791 (Fix ICE when validating transmuting ZST to inhabited enum) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #145540 - nia-e:prov-map-range, r=RalfJung interpret/allocation: get_range on ProvenanceMap Helper method to grab all provenances in a given address range for an allocation, making some logic in Miri nicer.
|
still in queue @bors r- |
Rollup of 14 pull requests Successful merges: - rust-lang/rust#143898 (opt-dist: rebuild rustc when doing static LLVM builds) - rust-lang/rust#144452 (std/sys/fd: Relax `READ_LIMIT` on Darwin) - rust-lang/rust#145234 (match exhaustiveness diagnostics: show a trailing comma on singleton tuple consructors in witness patterns (and clean up a little)) - rust-lang/rust#145515 (Optimize `char::encode_utf8`) - rust-lang/rust#145540 (interpret/allocation: get_range on ProvenanceMap) - rust-lang/rust#145670 (port `sanitize` attribute to the new parsing infrastructure) - rust-lang/rust#145713 (next-solver: fix `feature(const_trait_impl)` bootstrap) - rust-lang/rust#145729 (Remove two duplicated crates) - rust-lang/rust#145744 (miri: also detect aliasing of in-place argument and return place) - rust-lang/rust#145774 (Remove default opts from config) - rust-lang/rust#145781 (Remove profile section from Clippy) - rust-lang/rust#145782 (rustdoc: make attributes render consistently) - rust-lang/rust#145787 (citool: cleanup `mismatched_lifetime_syntaxes` warnings) - rust-lang/rust#145791 (Fix ICE when validating transmuting ZST to inhabited enum) r? `@ghost` `@rustbot` modify labels: rollup
Helper method to grab all provenances in a given address range for an allocation, making some logic in Miri nicer.