You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ifnot (Param.handle_atomic && ask.f MustBeAtomic) then
962
926
sideg (V.unprotected x) v; (* Delay publishing unprotected write in the atomic section. *)
@@ -965,11 +929,11 @@ struct
965
929
(* Unlock after invariant will still side effect refined value (if protected) from CPA, because cannot distinguish from non-invariant write since W is implicit. *)
966
930
);
967
931
ifParam.handle_atomic && ask.f MustBeAtomicthen
968
-
{st with cpa =CPA.add x v st.cpa; priv =D.add invariant x v st.priv} (* Keep write local as if it were protected by the atomic section. *)
969
-
elseifunprotectedthen
932
+
{st with cpa =CPA.add x v st.cpa; priv =P.add x st.priv} (* Keep write local as if it were protected by the atomic section. *)
933
+
elseifis_unprotected ask xthen
970
934
st
971
935
else
972
-
{st with cpa =CPA.add x v st.cpa; priv =D.add invariant x v st.priv}
936
+
{st with cpa =CPA.add x v st.cpa; priv =P.add x st.priv}
973
937
974
938
letlockaskgetgstm= st
975
939
@@ -979,22 +943,16 @@ struct
979
943
(* TODO: what about G_m globals in cpa that weren't actually written? *)
980
944
CPA.fold (funxv (st: BaseComponents (D).t) ->
981
945
if is_protected_by ask m x then ( (* is_in_Gm *)
982
-
(* Only apply sides for values that were actually written to globals!
983
-
This excludes invariants inferred through guards. *)
984
-
beginmatchD.precise_side x v st.priv with
985
-
|Somev -> begin
986
-
(* Extra precision in implementation to pass tests:
987
-
If global is read-protected by multiple locks,
988
-
then inner unlock shouldn't yet publish. *)
989
-
ifnotParam.check_read_unprotected || is_unprotected_without ask ~write:false x m then
990
-
sideg (V.protected x) v;
991
-
if atomic then
992
-
sideg (V.unprotected x) v; (* Publish delayed unprotected write as if it were protected by the atomic section. *)
993
-
end
994
-
|None -> ()
995
-
end;
946
+
(* Extra precision in implementation to pass tests:
947
+
If global is read-protected by multiple locks,
948
+
then inner unlock shouldn't yet publish. *)
949
+
ifnotParam.check_read_unprotected || is_unprotected_without ask ~write:false x m then
950
+
sideg (V.protected x) v;
951
+
if atomic then
952
+
sideg (V.unprotected x) v; (* Publish delayed unprotected write as if it were protected by the atomic section. *)
953
+
996
954
if is_unprotected_without ask x m then(* is_in_V' *)
997
-
{st with cpa =CPA.remove x st.cpa; priv =D.remove x st.priv}
955
+
{st with cpa =CPA.remove x st.cpa; priv =P.remove x st.priv}
998
956
else
999
957
st
1000
958
)
@@ -1010,7 +968,7 @@ struct
1010
968
if is_global ask x && is_unprotected ask x then (
1011
969
sideg (V.unprotected x) v;
1012
970
sideg (V.protected x) v; (* must be like enter_multithreaded *)
1013
-
{st with cpa =CPA.remove x st.cpa; priv =D.remove x st.priv}
971
+
{st with cpa =CPA.remove x st.cpa; priv =P.remove x st.priv}
1014
972
)
1015
973
else
1016
974
st
@@ -1049,7 +1007,7 @@ struct
1049
1007
if is_global ask x then (
1050
1008
sideg (V.unprotected x) v;
1051
1009
sideg (V.protected x) v;
1052
-
{st with cpa =CPA.remove x st.cpa; priv =D.remove x st.priv}
1010
+
{st with cpa =CPA.remove x st.cpa; priv =P.remove x st.priv}
1053
1011
)
1054
1012
else
1055
1013
st
@@ -2158,21 +2116,19 @@ end
2158
2116
2159
2117
let priv_module: (moduleS) Lazy.t =
2160
2118
lazy (
2161
-
let changes_only = get_bool "ana.base.priv.protection.changes-only"in
2162
-
letmodule ProtDom: ProtectionDom = (val if changes_only then (moduleProtectionChangesOnlySide : ProtectionDom) else (moduleProtectionCPASide)) in
2163
2119
letmodule Priv: S =
2164
2120
(val match get_string "ana.base.privatization"with
0 commit comments