@@ -482,14 +482,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
482
482
// Only metadata on the location itself is used.
483
483
let scalar = this. allow_data_races_ref ( move |this| this. read_scalar ( & place. into ( ) ) ) ?;
484
484
485
- if let Some ( global) = & this. memory . extra . data_race {
486
- let ( alloc_id, base_offset, ..) = this. memory . ptr_get_alloc ( place. ptr ) ?;
487
- if let Some ( alloc_buffers) = this. memory . get_alloc_extra ( alloc_id) ?. weak_memory . as_ref ( )
485
+ if let Some ( global) = & this. machine . data_race {
486
+ let ( alloc_id, base_offset, ..) = this. ptr_get_alloc_id ( place. ptr ) ?;
487
+ if let Some ( alloc_buffers) = this. get_alloc_extra ( alloc_id) ?. weak_memory . as_ref ( )
488
488
{
489
489
if atomic == AtomicReadOp :: SeqCst {
490
490
global. sc_read ( ) ;
491
491
}
492
- let mut rng = this. memory . extra . rng . borrow_mut ( ) ;
492
+ let mut rng = this. machine . rng . borrow_mut ( ) ;
493
493
let loaded = alloc_buffers. buffered_read (
494
494
alloc_range ( base_offset, place. layout . size ) ,
495
495
global,
@@ -517,11 +517,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
517
517
this. allow_data_races_mut ( move |this| this. write_scalar ( val, & ( * dest) . into ( ) ) ) ?;
518
518
519
519
this. validate_atomic_store ( dest, atomic) ?;
520
- let ( alloc_id, base_offset, ..) = this. memory . ptr_get_alloc ( dest. ptr ) ?;
520
+ let ( alloc_id, base_offset, ..) = this. ptr_get_alloc_id ( dest. ptr ) ?;
521
521
if let (
522
522
crate :: AllocExtra { weak_memory : Some ( alloc_buffers) , .. } ,
523
- crate :: MemoryExtra { data_race : Some ( global) , .. } ,
524
- ) = this. memory . get_alloc_extra_mut ( alloc_id) ?
523
+ crate :: Evaluator { data_race : Some ( global) , .. } ,
524
+ ) = this. get_alloc_extra_mut ( alloc_id) ?
525
525
{
526
526
if atomic == AtomicWriteOp :: SeqCst {
527
527
global. sc_write ( ) ;
@@ -659,14 +659,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
659
659
// in the modification order.
660
660
// Since `old` is only a value and not the store element, we need to separately
661
661
// find it in our store buffer and perform load_impl on it.
662
- if let Some ( global) = & this. memory . extra . data_race {
662
+ if let Some ( global) = & this. machine . data_race {
663
663
if fail == AtomicReadOp :: SeqCst {
664
664
global. sc_read ( ) ;
665
665
}
666
666
let size = place. layout . size ;
667
- let ( alloc_id, base_offset, ..) = this. memory . ptr_get_alloc ( place. ptr ) ?;
667
+ let ( alloc_id, base_offset, ..) = this. ptr_get_alloc_id ( place. ptr ) ?;
668
668
if let Some ( alloc_buffers) =
669
- this. memory . get_alloc_extra ( alloc_id) ?. weak_memory . as_ref ( )
669
+ this. get_alloc_extra ( alloc_id) ?. weak_memory . as_ref ( )
670
670
{
671
671
if global. multi_threaded . get ( ) {
672
672
alloc_buffers. read_from_last_store ( alloc_range ( base_offset, size) , global) ;
@@ -686,11 +686,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
686
686
atomic : AtomicRwOp ,
687
687
) -> InterpResult < ' tcx > {
688
688
let this = self . eval_context_mut ( ) ;
689
- let ( alloc_id, base_offset, ..) = this. memory . ptr_get_alloc ( place. ptr ) ?;
689
+ let ( alloc_id, base_offset, ..) = this. ptr_get_alloc_id ( place. ptr ) ?;
690
690
if let (
691
691
crate :: AllocExtra { weak_memory : Some ( alloc_buffers) , .. } ,
692
- crate :: MemoryExtra { data_race : Some ( global) , .. } ,
693
- ) = this. memory . get_alloc_extra_mut ( alloc_id) ?
692
+ crate :: Evaluator { data_race : Some ( global) , .. } ,
693
+ ) = this. get_alloc_extra_mut ( alloc_id) ?
694
694
{
695
695
if atomic == AtomicRwOp :: SeqCst {
696
696
global. sc_read ( ) ;
@@ -777,7 +777,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
777
777
fn validate_atomic_fence ( & mut self , atomic : AtomicFenceOp ) -> InterpResult < ' tcx > {
778
778
let this = self . eval_context_mut ( ) ;
779
779
if let Some ( data_race) = & mut this. machine . data_race {
780
- data_race. maybe_perform_sync_operation ( move |index, mut clocks| {
780
+ data_race. maybe_perform_sync_operation ( |index, mut clocks| {
781
781
log:: trace!( "Atomic fence on {:?} with ordering {:?}" , index, atomic) ;
782
782
783
783
// Apply data-race detection for the current fences
0 commit comments