@@ -554,6 +554,8 @@ struct FuncInfo<'tcx> {
554
554
/// get a complete [`Assignment`] for this function, which maps every [`PointerId`] in this
555
555
/// function to a [`PermissionSet`] and [`FlagSet`].
556
556
lasn : MaybeUnset < LocalAssignment > ,
557
+ /// Local part of the `updates_forbidden` mask.
558
+ l_updates_forbidden : MaybeUnset < LocalPointerTable < PermissionSet > > ,
557
559
/// Constraints on pointee types gathered from the body of this function.
558
560
pointee_constraints : MaybeUnset < pointee_type:: ConstraintSet < ' tcx > > ,
559
561
/// Local part of pointee type sets.
@@ -872,6 +874,8 @@ fn run(tcx: TyCtxt) {
872
874
const INITIAL_FLAGS : FlagSet = FlagSet :: empty ( ) ;
873
875
874
876
let mut gasn = GlobalAssignment :: new ( gacx. num_pointers ( ) , INITIAL_PERMS , INITIAL_FLAGS ) ;
877
+ let mut g_updates_forbidden = GlobalPointerTable :: new ( gacx. num_pointers ( ) ) ;
878
+
875
879
for ( ptr, & info) in gacx. ptr_info ( ) . iter ( ) {
876
880
if should_make_fixed ( info) {
877
881
gasn. flags [ ptr] . insert ( FlagSet :: FIXED ) ;
@@ -897,6 +901,7 @@ fn run(tcx: TyCtxt) {
897
901
for info in func_info. values_mut ( ) {
898
902
let num_pointers = info. acx_data . num_pointers ( ) ;
899
903
let mut lasn = LocalAssignment :: new ( num_pointers, INITIAL_PERMS , INITIAL_FLAGS ) ;
904
+ let l_updates_forbidden = LocalPointerTable :: new ( num_pointers) ;
900
905
901
906
for ( ptr, & info) in info. acx_data . local_ptr_info ( ) . iter ( ) {
902
907
if should_make_fixed ( info) {
@@ -905,6 +910,7 @@ fn run(tcx: TyCtxt) {
905
910
}
906
911
907
912
info. lasn . set ( lasn) ;
913
+ info. l_updates_forbidden . set ( l_updates_forbidden) ;
908
914
}
909
915
910
916
// Load permission info from PDG
@@ -1121,16 +1127,19 @@ fn run(tcx: TyCtxt) {
1121
1127
let field_ltys = gacx. field_ltys . clone ( ) ;
1122
1128
let acx = gacx. function_context_with_data ( & mir, info. acx_data . take ( ) ) ;
1123
1129
let mut asn = gasn. and ( & mut info. lasn ) ;
1130
+ let updates_forbidden = g_updates_forbidden. and ( & info. l_updates_forbidden ) ;
1124
1131
1125
1132
let r = panic_detail:: catch_unwind ( AssertUnwindSafe ( || {
1126
1133
// `dataflow.propagate` and `borrowck_mir` both run until the assignment converges
1127
1134
// on a fixpoint, so there's no need to do multiple iterations here.
1128
- info. dataflow . propagate ( & mut asn. perms_mut ( ) ) ;
1135
+ info. dataflow
1136
+ . propagate ( & mut asn. perms_mut ( ) , & updates_forbidden) ;
1129
1137
1130
1138
borrowck:: borrowck_mir (
1131
1139
& acx,
1132
1140
& info. dataflow ,
1133
1141
& mut asn. perms_mut ( ) ,
1142
+ & updates_forbidden,
1134
1143
name. as_str ( ) ,
1135
1144
& mir,
1136
1145
field_ltys,
0 commit comments