@@ -327,6 +327,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
327
327
// Let the machine take some extra action
328
328
let size = alloc. size ( ) ;
329
329
M :: memory_deallocated (
330
+ * self . tcx ,
330
331
& mut self . machine ,
331
332
& mut alloc. extra ,
332
333
ptr. provenance ,
@@ -509,7 +510,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
509
510
( self . tcx . eval_static_initializer ( def_id) ?, Some ( def_id) )
510
511
}
511
512
} ;
512
- M :: before_access_global ( & self . machine , id, alloc, def_id, is_write) ?;
513
+ M :: before_access_global ( * self . tcx , & self . machine , id, alloc, def_id, is_write) ?;
513
514
// We got tcx memory. Let the machine initialize its "extra" stuff.
514
515
let alloc = M :: init_allocation_extra (
515
516
self ,
@@ -575,7 +576,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
575
576
) ?;
576
577
if let Some ( ( alloc_id, offset, ptr, alloc) ) = ptr_and_alloc {
577
578
let range = alloc_range ( offset, size) ;
578
- M :: memory_read ( & self . machine , & alloc. extra , ptr. provenance , range) ?;
579
+ M :: memory_read ( * self . tcx , & self . machine , & alloc. extra , ptr. provenance , range) ?;
579
580
Ok ( Some ( AllocRef { alloc, range, tcx : * self . tcx , alloc_id } ) )
580
581
} else {
581
582
// Even in this branch we have to be sure that we actually access the allocation, in
@@ -636,7 +637,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
636
637
// We cannot call `get_raw_mut` inside `check_and_deref_ptr` as that would duplicate `&mut self`.
637
638
let ( alloc, machine) = self . get_alloc_raw_mut ( alloc_id) ?;
638
639
let range = alloc_range ( offset, size) ;
639
- M :: memory_written ( machine, & mut alloc. extra , ptr. provenance , range) ?;
640
+ M :: memory_written ( tcx , machine, & mut alloc. extra , ptr. provenance , range) ?;
640
641
Ok ( Some ( AllocRefMut { alloc, range, tcx, alloc_id } ) )
641
642
} else {
642
643
Ok ( None )
@@ -1009,7 +1010,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
1009
1010
} ;
1010
1011
let src_alloc = self . get_alloc_raw ( src_alloc_id) ?;
1011
1012
let src_range = alloc_range ( src_offset, size) ;
1012
- M :: memory_read ( & self . machine , & src_alloc. extra , src. provenance , src_range) ?;
1013
+ M :: memory_read ( * tcx , & self . machine , & src_alloc. extra , src. provenance , src_range) ?;
1013
1014
// We need the `dest` ptr for the next operation, so we get it now.
1014
1015
// We already did the source checks and called the hooks so we are good to return early.
1015
1016
let Some ( ( dest_alloc_id, dest_offset, dest) ) = dest_parts else {
@@ -1034,7 +1035,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
1034
1035
// Destination alloc preparations and access hooks.
1035
1036
let ( dest_alloc, extra) = self . get_alloc_raw_mut ( dest_alloc_id) ?;
1036
1037
let dest_range = alloc_range ( dest_offset, size * num_copies) ;
1037
- M :: memory_written ( extra, & mut dest_alloc. extra , dest. provenance , dest_range) ?;
1038
+ M :: memory_written ( * tcx , extra, & mut dest_alloc. extra , dest. provenance , dest_range) ?;
1038
1039
let dest_bytes = dest_alloc
1039
1040
. get_bytes_mut_ptr ( & tcx, dest_range)
1040
1041
. map_err ( |e| e. to_interp_error ( dest_alloc_id) ) ?
0 commit comments