Skip to content

Commit

Permalink
Flip Digest.accounted_for implementation to match name
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Dec 5, 2023
1 parent bda139f commit 0704cd5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/analyses/apron/relationPriv.apron.ml
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ struct
let get_relevant_writes (ask:Q.ask) m v =
let current = Digest.current ask in
GMutex.fold (fun k v acc ->
if Digest.accounted_for ask ~current ~other:k then
if not (Digest.accounted_for ask ~current ~other:k) then
LRD.join acc (Cluster.keep_only_protected_globals ask m v)
else
acc
Expand Down
2 changes: 1 addition & 1 deletion src/analyses/basePriv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ struct
let current = Digest.current ask in
let is_in_Gm x _ = is_protected_by ~protection:Weak ask m x in
GMutex.fold (fun k v acc ->
if Digest.accounted_for ask ~current ~other:k then
if not (Digest.accounted_for ask ~current ~other:k) then
CPA.join acc (CPA.filter is_in_Gm v)
else
acc
Expand Down
12 changes: 6 additions & 6 deletions src/analyses/commonPriv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@ struct
match current, other with
| `Lifted current, `Lifted other ->
if TID.is_unique current && TID.equal current other then
false (* self-read *)
true (* self-read *)
else if GobConfig.get_bool "ana.relation.priv.not-started" && MHP.definitely_not_started (current, ask.f Q.CreatedThreads) other then
false (* other is not started yet *)
true (* other is not started yet *)
else if GobConfig.get_bool "ana.relation.priv.must-joined" && MHP.must_be_joined other (ask.f Queries.MustJoinedThreads) then
false (* accounted for in local information *)
true (* accounted for in local information *)
else
true
| _ -> true
false
| _ -> false
end

module PerMutexTidCommon (Digest: Digest) (LD:Lattice.S) =
Expand Down Expand Up @@ -247,7 +247,7 @@ struct
let get_relevant_writes_nofilter (ask:Q.ask) v =
let current = Digest.current ask in
GMutex.fold (fun k v acc ->
if Digest.accounted_for ask ~current ~other:k then
if not (Digest.accounted_for ask ~current ~other:k) then
LD.join acc v
else
acc
Expand Down

0 comments on commit 0704cd5

Please sign in to comment.