-
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
Miri provenance cleanup #96165
Miri provenance cleanup #96165
Conversation
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
Or maybe it returns 3 things: I feel like this triple approach might be better for #95826 since it avoids having to extract the |
3b7816f
to
5f7e4cf
Compare
I like these changes, but I can't tell how the difference between the two and three element approaches will affect my code.
Can you clarify this? It looks like according to these changes that all |
5f7e4cf
to
0ef5ae3
Compare
I have added it to this PR. |
This comment has been minimized.
This comment has been minimized.
fn ptr_get_alloc( | ||
ecx: &InterpCx<'mir, 'tcx, Self>, | ||
ptr: Pointer<Self::PointerTag>, | ||
) -> (AllocId, Size); | ||
) -> (AllocId, Size, Self::TagExtra); |
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.
Technically, this is currently still redundant -- we could make this ptr_get_offset
and have it return just a Size
, and get all the other data directly from the PointerTag
.
But in preparation for @carbotaniuman's PR, I think we should leave this the way it is. After that PR, Provenance::get_alloc_id
should be called only for diagnostics and when Provenance::OFFSET_IS_ADDR == false
, and ptr_get_alloc
should be used throughout the machine to extract information from provenance. (And that's what we already do, so it would be silly to change it back and forth.)
0ef5ae3
to
c9e568f
Compare
8939f71
to
41ed646
Compare
41ed646
to
c83241a
Compare
@bors r+ |
📌 Commit 55f0977 has been approved by |
…=oli-obk Miri provenance cleanup Reviewing rust-lang#95826 by `@carbotaniuman` made me realize that we could clean things up a little here. `@carbotaniuman` please let me know if you're okay with landing this (it will create a lot of conflicts with your PR), or if you'd prefer incorporating the ideas from this PR into yours. I think we want to end up in a situation where the function you called `ptr_reify_alloc` returns just two things, a concrete tag and an offset. Getting an `AllocId` from a concrete tag should be infallible like now. However a concrete tag and `Tag` don't have to be the same type. r? `@oli-obk`
Rollup of 6 pull requests Successful merges: - rust-lang#95740 (asm: Add a kreg0 register class on x86 which includes k0) - rust-lang#95813 (Remove extra space before a where clause) - rust-lang#96029 (Refactor loop into iterator; simplify negation logic.) - rust-lang#96162 (interpret: Fix writing uninit to an allocation) - rust-lang#96165 (Miri provenance cleanup) - rust-lang#96205 (Use futex locks on emscripten.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
adjust for provenance cleanup This is the Miri side of rust-lang/rust#96165
Reviewing #95826 by @carbotaniuman made me realize that we could clean things up a little here.
@carbotaniuman please let me know if you're okay with landing this (it will create a lot of conflicts with your PR), or if you'd prefer incorporating the ideas from this PR into yours. I think we want to end up in a situation where the function you called
ptr_reify_alloc
returns just two things, a concrete tag and an offset. Getting anAllocId
from a concrete tag should be infallible like now. However a concrete tag andTag
don't have to be the same type.r? @oli-obk