Skip to content

Commit 88e78aa

Browse files
authored
comment tweak
1 parent f2d791b commit 88e78aa

File tree

1 file changed

+5
-2
lines changed
  • src/borrow_tracker/tree_borrows

1 file changed

+5
-2
lines changed

src/borrow_tracker/tree_borrows/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,11 @@ trait EvalContextPrivExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
355355
// Store initial permissions.
356356
for (_loc_range, loc) in perms_map.iter_mut(range.start, range.size) {
357357
let sifa = perm.strongest_idempotent_foreign_access(protected);
358-
// NOTE: `access` is false if and only if `perm` is Cell, so this `if`
359-
// doesn't not change whether any code is UB or not.
358+
// NOTE: Currently, `access` is false if and only if `perm` is Cell, so this `if`
359+
// doesn't not change whether any code is UB or not. We could just always use
360+
// `new_accessed` and everything would stay the same. But that seems conceptually
361+
// odd, so we keep the initial "accessed" bit of the `LocationState` in sync with whether
362+
// a read access is performed below.
360363
if access {
361364
*loc = LocationState::new_accessed(perm, sifa);
362365
} else {

0 commit comments

Comments
 (0)