This commit is contained in:
Ralf Jung 2022-07-06 21:45:47 -04:00
parent 5fed3ebc26
commit b6602f5d11
5 changed files with 10 additions and 5 deletions

View file

@ -1 +1 @@
7665c3543079ebc3710b676d0fd6951bedfd4b29
8824d131619e58a38bde8bcf56401629b91a204a

View file

@ -35,11 +35,13 @@ impl<'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'mir, 'tcx> {
Immediate::Scalar(l) => (l.check_init()?.to_bits(size)?, 0),
Immediate::ScalarPair(l1, l2) =>
(l1.check_init()?.to_bits(size)?, l2.check_init()?.to_bits(size)?),
Immediate::Uninit => throw_ub!(InvalidUninitBytes(None)),
};
let right = match **right {
Immediate::Scalar(r) => (r.check_init()?.to_bits(size)?, 0),
Immediate::ScalarPair(r1, r2) =>
(r1.check_init()?.to_bits(size)?, r2.check_init()?.to_bits(size)?),
Immediate::Uninit => throw_ub!(InvalidUninitBytes(None)),
};
let res = match bin_op {
Eq => left == right,

View file

@ -1,3 +1,4 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-preemption-rate=0
use std::thread;
@ -5,7 +6,9 @@ use std::thread;
struct MakeSend(*const i32);
unsafe impl Send for MakeSend {}
fn main() { race(0); }
fn main() {
race(0);
}
// Using an argument for the ptr to point to, since those do not get StorageDead.
fn race(local: i32) {

View file

@ -11,8 +11,8 @@ LL | }
note: inside `main` at $DIR/stack_pop_race.rs:LL:CC
--> $DIR/stack_pop_race.rs:LL:CC
|
LL | fn main() { race(0); }
| ^^^^^^^
LL | race(0);
| ^^^^^^^
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

View file

@ -24,7 +24,7 @@ fn unsized_params() {
f0(*c);
let foo = "foo".to_string().into_boxed_str();
f1(*foo);
let sl: Box::<[i32]> = [0, 1, 2].to_vec().into_boxed_slice();
let sl: Box<[i32]> = [0, 1, 2].to_vec().into_boxed_slice();
f2(5, *sl);
let p: Box<dyn Send> = Box::new((1, 2));
f3(*p);