Skip to content

Commit 73c4fce

Browse files
committed
Use bot instead of top for base mutex contents
This avoids unknown value escape warnings.
1 parent 861f881 commit 73c4fce

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
@@ -133,7 +133,7 @@ struct
133133

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

0 commit comments

Comments
 (0)