Uh oh!
There was an error while loading. Please reload this page.
prepare for Intptrcast model - #61781
Conversation
This comment has been minimized.
This comment has been minimized.
oli-obk
left a comment
There was a problem hiding this comment.
@RalfJung are you ok with us not nuking to_ptr and to_bits immediately? It would make the PR much more complex since we'd have to fiddle things through Allocation (in librustc where we don't know about the force* methods or InterpCX)
| } | ||
| } | ||
| pub fn force_bits(&self, scalar: Scalar<M::PointerTag>) -> InterpResult<'tcx, u128> { |
There was a problem hiding this comment.
I know this PR isn't going to full intptrcast in one step, but I think it should still use force_bits $somewhere. Maybe start with just
- (call
rust/src/librustc_mir/interpret/cast.rs
Line 251 in 24ddd16
cast_from_intafter you get the bits viaforce_bits) rust/src/librustc_mir/interpret/place.rs
Line 472 in 24ddd16
rust/src/librustc_mir/interpret/operator.rs
Line 313 in 24ddd16
rust/src/librustc_mir/interpret/operator.rs
Line 350 in 24ddd16
There was a problem hiding this comment.
I'll do these changes and add a commit :P
There was a problem hiding this comment.
No please don't do anything on casts! That's just a red herring, people can still transmute stuff. We need to do conversion lazily, nor eagerly.
I thought we had discussed in detail where force_ptr is needed? Namely, the methods in "place.rs" and "operand.rs" that access memory. And then for force_bits, that would arise only inside Miri in the newest plan, in ptr_op.
There was a problem hiding this comment.
Oh wait, that cast stuff is for non-ptr-sized casts. Hm. Okay we should eventually force_bits there.
But that should be properly deduplicated with the int-to-int cass, so I don't think that method is the right place. Maybe let's keep that one for later.
There was a problem hiding this comment.
D: ok I haven't committed anything. What should I do next then?
There was a problem hiding this comment.
Ok, I've already substituted to_ptr by force_ptr in the last commit, if the bin_op change is going to happen in miri, are we done here?
There was a problem hiding this comment.
Oh also force_bits shouldn't assume pointer size, that makes it rather inconvenient to use. It should take the size as argument, like to_bits does.
But it can assert that if the size is NOT pointer size, it will never see a pointer value.
I've already substituted to_ptr by force_ptr in the last commit
I hope you mean "carefully replaced in a few places", not "substituted everywhere with sed". ;)
There was a problem hiding this comment.
Hahaha, yeah I've just replaced them on the places with the @RalfJung approval seal.
There was a problem hiding this comment.
Oh sorry my bad, this was only about
force_bits. I should learn to read. :(I agree with the following two:
rust/src/librustc_mir/interpret/place.rs
Line 472 in 24ddd16
rust/src/librustc_mir/interpret/operator.rs
Line 350 in 24ddd16
But this one makes no sense to change as it already panics if there are no bits there.
I'm going to do those changes then
There was a problem hiding this comment.
Oh also
force_bitsshouldn't assume pointer size, that makes it rather inconvenient to use. It should take the size as argument, liketo_bitsdoes.
I'm going to do this change before the other ones then and will do a couple commits in a few minutes
RalfJung
commented
Jun 13, 2019
Absolutely, I didn't even necessarily expect them to be nuked at all. |
Uh oh!
There was an error while loading. Please reload this page.
pvdrz
commented
Jun 14, 2019
I believe CI needs to be invoked again, or force bors to do the merge test |
RalfJung
commented
Jun 14, 2019
Why that? Travis is green, and Azure can be ignored. ;) |
Uh oh!
There was an error while loading. Please reload this page.
pvdrz
commented
Jun 14, 2019
I had the impression bors won't do its work until both CI pipelines are green |
oli-obk
commented
Jun 14, 2019
bors will start even if all CI is red. |
Uh oh!
There was an error while loading. Please reload this page.
pvdrz
commented
Jun 14, 2019
Man these bots like to live dangerously :P |
oli-obk
commented
Jun 14, 2019
@bors r+ go live dangerously |
bors
commented
Jun 14, 2019
📌 Commit 212f233 has been approved by |
…=oli-obk prepare for Intptrcast model rust-lang#61668 done right (I hope so). r? @RalfJung@oli-obk
…=oli-obk prepare for Intptrcast model rust-lang#61668 done right (I hope so). r? @RalfJung@oli-obk
…=oli-obk prepare for Intptrcast model rust-lang#61668 done right (I hope so). r? @RalfJung@oli-obk
RalfJung
commented
Jun 16, 2019
@bors r- This seems to break Miri. And we should get at least one nightly with a working Miri, because currently the latest distributed Miri is broken. |
Uh oh!
There was an error while loading. Please reload this page.
pvdrz
commented
Jun 16, 2019
Ok problem fixed, miri tests are passing in local now |
RalfJung
commented
Jun 17, 2019
Awesome! @bors r=oli-obk,RalfJung |
bors
commented
Jun 17, 2019
📌 Commit 1e38870 has been approved by |
bors
commented
Jun 17, 2019
bors
commented
Jun 17, 2019
💔 Test failed - checks-travis |
rust-highfive
commented
Jun 17, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
oli-obk
commented
Jun 17, 2019
@bors retry timeout |
bors
commented
Jun 17, 2019
bors
commented
Jun 17, 2019
☀️ Test successful - checks-travis, status-appveyor |
#61668 done right (I hope so). r? @RalfJung@oli-obk