@@ -87,11 +87,11 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'a, 'mir, '
87
87
88
88
_ if intrinsic_name. starts_with ( "atomic_cxchg" ) => {
89
89
let ptr = self . ref_to_mplace ( self . read_immediate ( args[ 0 ] ) ?) ?;
90
- let expect_old = self . read_immediate ( args[ 1 ] ) ?; // read as value for the sake of `binary_op_val ()`
90
+ let expect_old = self . read_immediate ( args[ 1 ] ) ?; // read as value for the sake of `binary_op_imm ()`
91
91
let new = self . read_scalar ( args[ 2 ] ) ?;
92
- let old = self . read_immediate ( ptr. into ( ) ) ?; // read as value for the sake of `binary_op_val ()`
93
- // binary_op_val will bail if either of them is not a scalar
94
- let ( eq, _) = self . binary_op_val ( mir:: BinOp :: Eq , old, expect_old) ?;
92
+ let old = self . read_immediate ( ptr. into ( ) ) ?; // read as value for the sake of `binary_op_imm ()`
93
+ // binary_op_imm will bail if either of them is not a scalar
94
+ let ( eq, _) = self . binary_op_imm ( mir:: BinOp :: Eq , old, expect_old) ?;
95
95
let res = Immediate :: ScalarPair ( old. to_scalar_or_undef ( ) , eq. into ( ) ) ;
96
96
self . write_immediate ( res, dest) ?; // old value is returned
97
97
// update ptr depending on comparison
@@ -234,7 +234,7 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'a, 'mir, '
234
234
let a = self . read_immediate ( args[ 0 ] ) ?;
235
235
let b = self . read_immediate ( args[ 1 ] ) ?;
236
236
// check x % y != 0
237
- if self . binary_op_val ( mir:: BinOp :: Rem , a, b) ?. 0 . to_bytes ( ) ? != 0 {
237
+ if self . binary_op_imm ( mir:: BinOp :: Rem , a, b) ?. 0 . to_bytes ( ) ? != 0 {
238
238
return err ! ( ValidationFailure ( format!( "exact_div: {:?} cannot be divided by {:?}" , a, b) ) ) ;
239
239
}
240
240
self . binop_ignore_overflow ( mir:: BinOp :: Div , a, b, dest) ?;
0 commit comments