@@ -327,6 +327,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
327327 // Let the machine take some extra action
328328 let size = alloc. size ( ) ;
329329 M :: memory_deallocated (
330+ * self . tcx ,
330331 & mut self . machine ,
331332 & mut alloc. extra ,
332333 ptr. provenance ,
@@ -509,7 +510,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
509510 ( self . tcx . eval_static_initializer ( def_id) ?, Some ( def_id) )
510511 }
511512 } ;
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) ?;
513514 // We got tcx memory. Let the machine initialize its "extra" stuff.
514515 let alloc = M :: init_allocation_extra (
515516 self ,
@@ -575,7 +576,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
575576 ) ?;
576577 if let Some ( ( alloc_id, offset, ptr, alloc) ) = ptr_and_alloc {
577578 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) ?;
579580 Ok ( Some ( AllocRef { alloc, range, tcx : * self . tcx , alloc_id } ) )
580581 } else {
581582 // 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> {
636637 // We cannot call `get_raw_mut` inside `check_and_deref_ptr` as that would duplicate `&mut self`.
637638 let ( alloc, machine) = self . get_alloc_raw_mut ( alloc_id) ?;
638639 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) ?;
640641 Ok ( Some ( AllocRefMut { alloc, range, tcx, alloc_id } ) )
641642 } else {
642643 Ok ( None )
@@ -1009,7 +1010,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
10091010 } ;
10101011 let src_alloc = self . get_alloc_raw ( src_alloc_id) ?;
10111012 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) ?;
10131014 // We need the `dest` ptr for the next operation, so we get it now.
10141015 // We already did the source checks and called the hooks so we are good to return early.
10151016 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> {
10341035 // Destination alloc preparations and access hooks.
10351036 let ( dest_alloc, extra) = self . get_alloc_raw_mut ( dest_alloc_id) ?;
10361037 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) ?;
10381039 let dest_bytes = dest_alloc
10391040 . get_bytes_mut_ptr ( & tcx, dest_range)
10401041 . map_err ( |e| e. to_interp_error ( dest_alloc_id) ) ?
0 commit comments