Skip to content

Commit 9ea11c7

Browse files
committed
Remove the special treatment for RegMap empty values (dangerous!)
1 parent ab91237 commit 9ea11c7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/analyses/region.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ struct
6262
include Printable.Option (Lvals) (struct let name = "no region" end)
6363
let name () = "region"
6464
let may_race r1 r2 = match r1, r2 with
65+
(* Fresh memory does not race: *)
6566
| None, _
6667
| _, None -> false
67-
(* TODO: Should it happen in the first place that RegMap has empty value? Happens in 09-regions/34-escape_rc *)
68-
| Some r1, _ when Lvals.is_empty r1 -> true
69-
| _, Some r2 when Lvals.is_empty r2 -> true
68+
(* The following cases are needed if RegMap has empty values, due to bugs.
69+
When not handling escape, 09-regions/34-escape_rc would fail without this:
70+
| Some r1, _ when Lvals.is_empty r1 -> true
71+
| _, Some r2 when Lvals.is_empty r2 -> true *)
7072
| Some r1, Some r2 when Lvals.disjoint r1 r2 -> false
7173
| _, _ -> true
7274
let should_print r = match r with

0 commit comments

Comments
 (0)