@@ -10,7 +10,7 @@ use rustc_target::abi::{Align, Integer, LayoutOf};
10
10
use crate :: * ;
11
11
use helpers:: check_arg_count;
12
12
13
- enum AtomicOp {
13
+ pub enum AtomicOp {
14
14
MirOp ( mir:: BinOp , bool ) ,
15
15
Max ,
16
16
Min ,
@@ -605,15 +605,15 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
605
605
"atomic_umin_relaxed" =>
606
606
this. atomic_op_min_max ( args, dest, AtomicOp :: Min , AtomicRwOp :: Relaxed ) ?,
607
607
"atomic_umax" =>
608
- this. atomic_op_min_max ( args, dest, AtomicOp :: Min , AtomicRwOp :: SeqCst ) ?,
608
+ this. atomic_op_min_max ( args, dest, AtomicOp :: Max , AtomicRwOp :: SeqCst ) ?,
609
609
"atomic_umax_acq" =>
610
- this. atomic_op_min_max ( args, dest, AtomicOp :: Min , AtomicRwOp :: Acquire ) ?,
610
+ this. atomic_op_min_max ( args, dest, AtomicOp :: Max , AtomicRwOp :: Acquire ) ?,
611
611
"atomic_umax_rel" =>
612
- this. atomic_op_min_max ( args, dest, AtomicOp :: Min , AtomicRwOp :: Release ) ?,
612
+ this. atomic_op_min_max ( args, dest, AtomicOp :: Max , AtomicRwOp :: Release ) ?,
613
613
"atomic_umax_acqrel" =>
614
- this. atomic_op_min_max ( args, dest, AtomicOp :: Min , AtomicRwOp :: AcqRel ) ?,
614
+ this. atomic_op_min_max ( args, dest, AtomicOp :: Max , AtomicRwOp :: AcqRel ) ?,
615
615
"atomic_umax_relaxed" =>
616
- this. atomic_op_min_max ( args, dest, AtomicOp :: Min , AtomicRwOp :: Relaxed ) ?,
616
+ this. atomic_op_min_max ( args, dest, AtomicOp :: Max , AtomicRwOp :: Relaxed ) ?,
617
617
618
618
// Query type information
619
619
"assert_zero_valid" | "assert_uninit_valid" => {
@@ -754,12 +754,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
754
754
755
755
match atomic_op {
756
756
AtomicOp :: Min => {
757
- let old = this. atomic_min_max_scalar ( place, rhs, true , atomic) ?;
757
+ let old = this. atomic_min_max_scalar ( & place, rhs, true , atomic) ?;
758
758
this. write_immediate ( * old, & dest) ?; // old value is returned
759
759
Ok ( ( ) )
760
760
}
761
761
AtomicOp :: Max => {
762
- let old = this. atomic_min_max_scalar ( place, rhs, false , atomic) ?;
762
+ let old = this. atomic_min_max_scalar ( & place, rhs, false , atomic) ?;
763
763
this. write_immediate ( * old, & dest) ?; // old value is returned
764
764
Ok ( ( ) )
765
765
}
0 commit comments