Skip to content

Commit 2074399

Browse files
committed
Use bot instead of top for base mutex contents
This avoids unknown value escape warnings.
1 parent 5a92f7b commit 2074399

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cdomains/valueDomain.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ struct
135135

136136
let rec init_value (t: typ): t = (* top_value is not used here because structs, blob etc will not contain the right members *)
137137
match t with
138-
| t when is_mutex_type t -> `Top
138+
| t when is_mutex_type t -> `Bot (* use `Bot instead of `Top to avoid unknown value escape warnings *)
139139
| TInt (ik,_) -> `Int (ID.top_of ik)
140140
| TPtr _ -> `Address AD.top_ptr
141141
| TComp ({cstruct=true; _} as ci,_) -> `Struct (Structs.create (fun fd -> init_value fd.ftype) ci)
@@ -855,7 +855,8 @@ struct
855855
let mu = function `Blob (`Blob (y, s', orig), s, orig2) -> `Blob (y, ID.join s s',orig) | x -> x in
856856
let r =
857857
match x, offs with
858-
| _, _ when is_mutex_type t -> `Top (* hide mutex structure contents, not updated anyway *)
858+
| _, _ when is_mutex_type t -> (* hide mutex structure contents, not updated anyway *)
859+
`Bot (* use `Bot instead of `Top to avoid unknown value escape warnings *)
859860
| `Blob (x,s,orig), `Index (_,ofs) ->
860861
begin
861862
let l', o' = shift_one_over l o in

0 commit comments

Comments
 (0)