Skip to content

Commit 7ab2d12

Browse files
author
The rustc-dev-guide Cronjob Bot
committed
Merge from rustc
2 parents 12bf1ac + 73e6bb3 commit 7ab2d12

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/concurrency/data_race.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ pub trait EvalContextExt<'tcx>: MiriInterpCxExt<'tcx> {
717717
// The program didn't actually do a read, so suppress the memory access hooks.
718718
// This is also a very special exception where we just ignore an error -- if this read
719719
// was UB e.g. because the memory is uninitialized, we don't want to know!
720-
let old_val = this.run_for_validation(|this| this.read_scalar(dest)).discard_err();
720+
let old_val = this.run_for_validation_mut(|this| this.read_scalar(dest)).discard_err();
721721
this.allow_data_races_mut(move |this| this.write_scalar(val, dest))?;
722722
this.validate_atomic_store(dest, atomic)?;
723723
this.buffered_atomic_write(val, dest, atomic, old_val)

src/intrinsics/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
411411
};
412412
let res = this.binary_op(op, &a, &b)?;
413413
// `binary_op` already called `generate_nan` if needed.
414-
// Apply a relative error of 16ULP to simulate non-deterministic precision loss
414+
// Apply a relative error of 4ULP to simulate non-deterministic precision loss
415415
// due to optimizations.
416-
let res = apply_random_float_error_to_imm(this, res, 4 /* log2(16) */)?;
416+
let res = apply_random_float_error_to_imm(this, res, 2 /* log2(4) */)?;
417417
this.write_immediate(*res, dest)?;
418418
}
419419

@@ -464,9 +464,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
464464
if !float_finite(&res)? {
465465
throw_ub_format!("`{intrinsic_name}` intrinsic produced non-finite value as result");
466466
}
467-
// Apply a relative error of 16ULP to simulate non-deterministic precision loss
467+
// Apply a relative error of 4ULP to simulate non-deterministic precision loss
468468
// due to optimizations.
469-
let res = apply_random_float_error_to_imm(this, res, 4 /* log2(16) */)?;
469+
let res = apply_random_float_error_to_imm(this, res, 2 /* log2(4) */)?;
470470
this.write_immediate(*res, dest)?;
471471
}
472472

0 commit comments

Comments
 (0)