diff options
| author | bors <bors@rust-lang.org> | 2024-05-02 09:17:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-05-02 09:17:18 +0000 |
| commit | ca3defe245168691be9003ea2539651a69a8e37a (patch) | |
| tree | a813b4fac2f173bf2a7feddf34421f8dd13bbc26 /src | |
| parent | b0bdbcc5e5c753695837926a616f8ddb82089c39 (diff) | |
| parent | aa986f080080e293d059255baee26638728eaee7 (diff) | |
| download | rust-ca3defe245168691be9003ea2539651a69a8e37a.tar.gz rust-ca3defe245168691be9003ea2539651a69a8e37a.zip | |
Auto merge of #3532 - RalfJung:tb-protectors, r=RalfJung
Tree Borrows: first apply transition, then check protector with new 'initialized'
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs b/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs index 2470624181e..ff4589657af 100644 --- a/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs +++ b/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs @@ -106,6 +106,8 @@ impl LocationState { let old_perm = self.permission; let transition = Permission::perform_access(access_kind, rel_pos, old_perm, protected) .ok_or(TransitionError::ChildAccessForbidden(old_perm))?; + self.initialized |= !rel_pos.is_foreign(); + self.permission = transition.applied(old_perm).unwrap(); // Why do only initialized locations cause protector errors? // Consider two mutable references `x`, `y` into disjoint parts of // the same allocation. A priori, these may actually both be used to @@ -123,8 +125,6 @@ impl LocationState { if protected && self.initialized && transition.produces_disabled() { return Err(TransitionError::ProtectedDisabled(old_perm)); } - self.permission = transition.applied(old_perm).unwrap(); - self.initialized |= !rel_pos.is_foreign(); Ok(transition) } |
