Skip to content

Commit

Permalink
Use bot instead of top for base mutex contents
Browse files Browse the repository at this point in the history
This avoids unknown value escape warnings.
  • Loading branch information
sim642 committed May 27, 2022
1 parent 5a92f7b commit 2074399
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cdomains/valueDomain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ struct

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

0 comments on commit 2074399

Please sign in to comment.