@@ -294,24 +294,6 @@ trait EvalContextPrivExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
294294 return interp_ok ( Some ( Provenance :: Concrete { alloc_id, tag : new_tag } ) ) ;
295295 }
296296
297- let span = this. machine . current_span ( ) ;
298-
299- // When adding a new node, the SIFA of its parents needs to be updated, potentially across
300- // the entire memory range. For the parts that are being accessed below, the access itself
301- // trivially takes care of that. However, we have to do some more work to also deal with the
302- // parts that are not being accessed. Specifically what we do is that we call
303- // `update_last_accessed_after_retag` on the SIFA of the permission set for the part of
304- // memory outside `perm_map` -- so that part is definitely taken care of. The remaining
305- // concern is the part of memory that is in the range of `perms_map`, but not accessed
306- // below. There we have two cases:
307- // * If the type is `!Freeze`, then the non-accessed part uses `nonfreeze_perm`, so the
308- // `nonfreeze_perm` initialized parts are also fine. We enforce the `freeze_perm` parts to
309- // be accessed via the assert below, and thus everything is taken care of.
310- // * If the type is `Freeze`, then `freeze_perm` is used everywhere (both inside and outside
311- // the initial range), and we update everything to have the `freeze_perm`'s SIFA, so there
312- // are no issues. (And this assert below is not actually needed in this case).
313- assert ! ( new_perm. freeze_access) ;
314-
315297 let protected = new_perm. protector . is_some ( ) ;
316298 let precise_interior_mut = this
317299 . machine
@@ -337,7 +319,7 @@ trait EvalContextPrivExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
337319 LocationState :: new_non_accessed ( perm, sifa)
338320 }
339321 } ;
340- let perms_map = if !precise_interior_mut {
322+ let inside_perms = if !precise_interior_mut {
341323 // For `!Freeze` types, just pretend the entire thing is an `UnsafeCell`.
342324 let ty_is_freeze = place. layout . ty . is_freeze ( * this. tcx , this. typing_env ( ) ) ;
343325 let state = loc_state ( ty_is_freeze) ;
@@ -364,8 +346,8 @@ trait EvalContextPrivExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
364346 let alloc_extra = this. get_alloc_extra ( alloc_id) ?;
365347 let mut tree_borrows = alloc_extra. borrow_tracker_tb ( ) . borrow_mut ( ) ;
366348
367- for ( perm_range, perm) in perms_map . iter_all ( ) {
368- if perm. is_accessed ( ) {
349+ for ( perm_range, perm) in inside_perms . iter_all ( ) {
350+ if perm. accessed ( ) {
369351 // Some reborrows incur a read access to the parent.
370352 // Adjust range to be relative to allocation start (rather than to `place`).
371353 let range_in_alloc = AllocRange {
@@ -401,10 +383,10 @@ trait EvalContextPrivExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
401383 base_offset,
402384 orig_tag,
403385 new_tag,
404- perms_map ,
386+ inside_perms ,
405387 new_perm. outside_perm ,
406388 protected,
407- span ,
389+ this . machine . current_span ( ) ,
408390 ) ?;
409391 drop ( tree_borrows) ;
410392
0 commit comments