File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/tools/miri/src/borrow_tracker/tree_borrows Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ impl LocationState {
106106 let old_perm = self . permission ;
107107 let transition = Permission :: perform_access ( access_kind, rel_pos, old_perm, protected)
108108 . ok_or ( TransitionError :: ChildAccessForbidden ( old_perm) ) ?;
109+ self . initialized |= !rel_pos. is_foreign ( ) ;
110+ self . permission = transition. applied ( old_perm) . unwrap ( ) ;
109111 // Why do only initialized locations cause protector errors?
110112 // Consider two mutable references `x`, `y` into disjoint parts of
111113 // the same allocation. A priori, these may actually both be used to
@@ -123,8 +125,6 @@ impl LocationState {
123125 if protected && self . initialized && transition. produces_disabled ( ) {
124126 return Err ( TransitionError :: ProtectedDisabled ( old_perm) ) ;
125127 }
126- self . permission = transition. applied ( old_perm) . unwrap ( ) ;
127- self . initialized |= !rel_pos. is_foreign ( ) ;
128128 Ok ( transition)
129129 }
130130
You can’t perform that action at this time.
0 commit comments