Uh oh!
There was an error while loading. Please reload this page.
Miri: dispatch first on the type - #62946
Conversation
rust-highfive
commented
Jul 24, 2019
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
RalfJung
commented
Jul 24, 2019
RalfJung
commented
Jul 24, 2019
The Miri side of this is at rust-lang/miri#856. I verified that the test suite passes. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Actually, the PR as-is makes this fail: constX2:bool = unsafe{42as*consti32 == 43as*consti32};The reason is that I suppose this is something we have to keep working, for backwards compatibility? |
RalfJung
commented
Jul 24, 2019
If we do want this, I think the cleanest way would be to move https://github.com/rust-lang/miri/blob/5a9ea5d1b61a860b95916366b17cce8349450332/src/operator.rs#L52-L78 into the engine. It will still fail in CTFE if either input is a pointer because What do you think? |
oli-obk
commented
Jul 24, 2019
No, just break it. Pointer comparisons are unstable at the type level for a reason |
RalfJung
commented
Jul 24, 2019
@oli-obk I think I took care of your nits. I also had to update some test files and rebase. Please check. |
54f900f to
3cd4079Compare
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
RalfJung
commented
Jul 25, 2019
Now that's surprising, why does this affect |
RalfJung
commented
Jul 25, 2019
Turns out const_prop was doing ptr-to-int casts based on CTFE doing that. With CTFE not doing that any more, const_prop cannot do it any more, either. Cc @wesleywiser |
oli-obk
commented
Jul 31, 2019
@bors r+ |
bors
commented
Jul 31, 2019
📌 Commit d7b9bbf has been approved by |
…en dispatching further; call ptr_op machine hook only for pointer types
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
12a29d9 to
b9db95eCompareRalfJung
commented
Aug 2, 2019
Rebased. @bors r=oli-obk |
bors
commented
Aug 2, 2019
📌 Commit b9db95e has been approved by |
bors
commented
Aug 3, 2019
Miri: dispatch first on the type Based on the fact that Miri now always has intptrcast available, we can change binops and casts to first check the type of the source operand and then decide based on that what to do, instead of considering the value (pointer vs bits) first.
bors
commented
Aug 3, 2019
☀️ Test successful - checks-azure |
Adjust for ptr_op changes This is the Miri side of rust-lang/rust#62946.
Adjust for ptr_op changes This is the Miri side of rust-lang/rust#62946.
Based on the fact that Miri now always has intptrcast available, we can change binops and casts to first check the type of the source operand and then decide based on that what to do, instead of considering the value (pointer vs bits) first.