File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,11 +46,7 @@ struct
4646 let not_started = MHP. definitely_not_started (current, created_threads) tid in
4747 let possibly_started = not not_started in
4848 (* If [current] is possibly running together with [tid], but is also joined before the free() in [tid], then no need to WARN *)
49- let current_joined_before_free = match current with
50- | ThreadIdDomain. Thread ft -> ConcDomain.FiniteMustThreadSet. mem ft joined_threads
51- | ThreadIdDomain. UnknownThread -> false
52- in
53- possibly_started && not current_joined_before_free
49+ possibly_started && not (ConcDomain.FiniteMustThreadSet. mem_lifted current joined_threads)
5450 | `Top -> true
5551 | `Bot -> false
5652 in
Original file line number Diff line number Diff line change 11(* * Domains for thread sets and their uniqueness. *)
22
3- module FiniteMustThreadSet = SetDomain. Reverse (SetDomain. Make (ThreadIdDomain. FlagConfiguredTID ))
3+ module FiniteMustThreadSet = struct
4+ include SetDomain. Reverse (SetDomain. Make (ThreadIdDomain. FlagConfiguredTID ))
5+
6+ let mem_lifted lifted_tid set =
7+ match lifted_tid with
8+ | ThreadIdDomain. Thread ft -> mem ft set
9+ | ThreadIdDomain. UnknownThread -> false
10+ end
411
512module ThreadSet =
613struct
@@ -22,11 +29,7 @@ struct
2229 let narrow x y = merge (fun x y -> widen x (join x y)) narrow x y
2330
2431 let diff_mustset x (y : FiniteMustThreadSet.t ) =
25- filter (fun t ->
26- match t with
27- | ThreadIdDomain. Thread ft -> not (FiniteMustThreadSet. mem ft y)
28- | ThreadIdDomain. UnknownThread -> true
29- ) x
32+ FiniteMustThreadSet. fold (fun t -> remove (ThreadIdDomain. Thread t)) y x
3033end
3134
3235module CreatedThreadSet = ThreadSet
Original file line number Diff line number Diff line change @@ -65,11 +65,8 @@ let definitely_not_started (current, created) other =
6565let exists_definitely_not_started_in_joined (current ,created ) other_joined =
6666 ConcDomain.FiniteMustThreadSet. exists (fun ft -> definitely_not_started (current, created) (ThreadIdDomain. Thread ft)) other_joined
6767
68- (* * Must the thread with thread id other be already joined *)
69- let must_be_joined other joined =
70- match other with
71- | ThreadIdDomain. Thread ft -> ConcDomain.FiniteMustThreadSet. mem ft joined
72- | ThreadIdDomain. UnknownThread -> false
68+ (* * Must the thread be already joined *)
69+ let must_be_joined = ConcDomain.FiniteMustThreadSet. mem_lifted
7370
7471(* * May two program points with respective MHP information happen in parallel *)
7572let may_happen_in_parallel one two =
You can’t perform that action at this time.
0 commit comments