@@ -327,7 +327,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
327327
328328 // Let the machine take some extra action
329329 let size = alloc. size ( ) ;
330- M :: memory_deallocated (
330+ M :: before_memory_deallocation (
331331 * self . tcx ,
332332 & mut self . machine ,
333333 & mut alloc. extra ,
@@ -575,7 +575,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
575575 ) ?;
576576 if let Some ( ( alloc_id, offset, prov, alloc) ) = ptr_and_alloc {
577577 let range = alloc_range ( offset, size) ;
578- M :: memory_read ( * self . tcx , & self . machine , & alloc. extra , ( alloc_id, prov) , range) ?;
578+ M :: before_memory_read ( * self . tcx , & self . machine , & alloc. extra , ( alloc_id, prov) , range) ?;
579579 Ok ( Some ( AllocRef { alloc, range, tcx : * self . tcx , alloc_id } ) )
580580 } else {
581581 // Even in this branch we have to be sure that we actually access the allocation, in
@@ -641,7 +641,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
641641 // We cannot call `get_raw_mut` inside `check_and_deref_ptr` as that would duplicate `&mut self`.
642642 let ( alloc, machine) = self . get_alloc_raw_mut ( alloc_id) ?;
643643 let range = alloc_range ( offset, size) ;
644- M :: memory_written ( tcx, machine, & mut alloc. extra , ( alloc_id, prov) , range) ?;
644+ M :: before_memory_write ( tcx, machine, & mut alloc. extra , ( alloc_id, prov) , range) ?;
645645 Ok ( Some ( AllocRefMut { alloc, range, tcx, alloc_id } ) )
646646 } else {
647647 Ok ( None )
@@ -1078,7 +1078,13 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
10781078 } ;
10791079 let src_alloc = self . get_alloc_raw ( src_alloc_id) ?;
10801080 let src_range = alloc_range ( src_offset, size) ;
1081- M :: memory_read ( * tcx, & self . machine , & src_alloc. extra , ( src_alloc_id, src_prov) , src_range) ?;
1081+ M :: before_memory_read (
1082+ * tcx,
1083+ & self . machine ,
1084+ & src_alloc. extra ,
1085+ ( src_alloc_id, src_prov) ,
1086+ src_range,
1087+ ) ?;
10821088 // We need the `dest` ptr for the next operation, so we get it now.
10831089 // We already did the source checks and called the hooks so we are good to return early.
10841090 let Some ( ( dest_alloc_id, dest_offset, dest_prov) ) = dest_parts else {
@@ -1103,7 +1109,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
11031109 // Destination alloc preparations and access hooks.
11041110 let ( dest_alloc, extra) = self . get_alloc_raw_mut ( dest_alloc_id) ?;
11051111 let dest_range = alloc_range ( dest_offset, size * num_copies) ;
1106- M :: memory_written (
1112+ M :: before_memory_write (
11071113 * tcx,
11081114 extra,
11091115 & mut dest_alloc. extra ,
0 commit comments