@@ -327,7 +327,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
327
327
328
328
// Let the machine take some extra action
329
329
let size = alloc. size ( ) ;
330
- M :: memory_deallocated (
330
+ M :: before_memory_deallocation (
331
331
* self . tcx ,
332
332
& mut self . machine ,
333
333
& mut alloc. extra ,
@@ -575,7 +575,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
575
575
) ?;
576
576
if let Some ( ( alloc_id, offset, prov, alloc) ) = ptr_and_alloc {
577
577
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) ?;
579
579
Ok ( Some ( AllocRef { alloc, range, tcx : * self . tcx , alloc_id } ) )
580
580
} else {
581
581
// 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> {
641
641
// We cannot call `get_raw_mut` inside `check_and_deref_ptr` as that would duplicate `&mut self`.
642
642
let ( alloc, machine) = self . get_alloc_raw_mut ( alloc_id) ?;
643
643
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) ?;
645
645
Ok ( Some ( AllocRefMut { alloc, range, tcx, alloc_id } ) )
646
646
} else {
647
647
Ok ( None )
@@ -1078,7 +1078,13 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
1078
1078
} ;
1079
1079
let src_alloc = self . get_alloc_raw ( src_alloc_id) ?;
1080
1080
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
+ ) ?;
1082
1088
// We need the `dest` ptr for the next operation, so we get it now.
1083
1089
// We already did the source checks and called the hooks so we are good to return early.
1084
1090
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> {
1103
1109
// Destination alloc preparations and access hooks.
1104
1110
let ( dest_alloc, extra) = self . get_alloc_raw_mut ( dest_alloc_id) ?;
1105
1111
let dest_range = alloc_range ( dest_offset, size * num_copies) ;
1106
- M :: memory_written (
1112
+ M :: before_memory_write (
1107
1113
* tcx,
1108
1114
extra,
1109
1115
& mut dest_alloc. extra ,
0 commit comments