miri weak memory emulation: initialize store buffer only on atomic writes; pre-fill with previous value

This commit is contained in:
Ralf Jung 2024-08-10 21:54:44 +02:00
parent 04ba50e823
commit 8b18c6bdd3
6 changed files with 153 additions and 109 deletions

View file

@ -1011,7 +1011,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
///
/// We do this so Miri's allocation access tracking does not show the validation
/// reads as spurious accesses.
pub(super) fn run_for_validation<R>(&self, f: impl FnOnce() -> R) -> R {
pub fn run_for_validation<R>(&self, f: impl FnOnce() -> R) -> R {
// This deliberately uses `==` on `bool` to follow the pattern
// `assert!(val.replace(new) == old)`.
assert!(