@@ -508,14 +508,14 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
508
508
#[ inline( always) ]
509
509
fn memory_read (
510
510
_memory_extra : & Self :: MemoryExtra ,
511
- alloc : & Allocation < Tag , AllocExtra > ,
511
+ alloc_extra : & AllocExtra ,
512
512
ptr : Pointer < Tag > ,
513
513
size : Size ,
514
514
) -> InterpResult < ' tcx > {
515
- if let Some ( data_race) = & alloc . extra . data_race {
515
+ if let Some ( data_race) = & alloc_extra . data_race {
516
516
data_race. read ( ptr, size) ?;
517
517
}
518
- if let Some ( stacked_borrows) = & alloc . extra . stacked_borrows {
518
+ if let Some ( stacked_borrows) = & alloc_extra . stacked_borrows {
519
519
stacked_borrows. memory_read ( ptr, size)
520
520
} else {
521
521
Ok ( ( ) )
@@ -525,14 +525,14 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
525
525
#[ inline( always) ]
526
526
fn memory_written (
527
527
_memory_extra : & mut Self :: MemoryExtra ,
528
- alloc : & mut Allocation < Tag , AllocExtra > ,
528
+ alloc_extra : & mut AllocExtra ,
529
529
ptr : Pointer < Tag > ,
530
530
size : Size ,
531
531
) -> InterpResult < ' tcx > {
532
- if let Some ( data_race) = & mut alloc . extra . data_race {
532
+ if let Some ( data_race) = & mut alloc_extra . data_race {
533
533
data_race. write ( ptr, size) ?;
534
534
}
535
- if let Some ( stacked_borrows) = & mut alloc . extra . stacked_borrows {
535
+ if let Some ( stacked_borrows) = & mut alloc_extra . stacked_borrows {
536
536
stacked_borrows. memory_written ( ptr, size)
537
537
} else {
538
538
Ok ( ( ) )
@@ -542,17 +542,17 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
542
542
#[ inline( always) ]
543
543
fn memory_deallocated (
544
544
memory_extra : & mut Self :: MemoryExtra ,
545
- alloc : & mut Allocation < Tag , AllocExtra > ,
545
+ alloc_extra : & mut AllocExtra ,
546
546
ptr : Pointer < Tag > ,
547
+ size : Size ,
547
548
) -> InterpResult < ' tcx > {
548
- let size = alloc. size ( ) ;
549
549
if Some ( ptr. alloc_id ) == memory_extra. tracked_alloc_id {
550
550
register_diagnostic ( NonHaltingDiagnostic :: FreedAlloc ( ptr. alloc_id ) ) ;
551
551
}
552
- if let Some ( data_race) = & mut alloc . extra . data_race {
552
+ if let Some ( data_race) = & mut alloc_extra . data_race {
553
553
data_race. deallocate ( ptr, size) ?;
554
554
}
555
- if let Some ( stacked_borrows) = & mut alloc . extra . stacked_borrows {
555
+ if let Some ( stacked_borrows) = & mut alloc_extra . stacked_borrows {
556
556
stacked_borrows. memory_deallocated ( ptr, size)
557
557
} else {
558
558
Ok ( ( ) )
0 commit comments