Skip to content

Commit

Permalink
Fix LockDomain.Lockset for NullPtr
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Apr 4, 2024
1 parent 5e4717e commit bd0468b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/cdomains/lockDomain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ struct
let name () = "lockset"

let add ((addr, _) as lock) set =
if Addr.is_definite addr then
match addr with
| Addr.Addr mv when Addr.Mval.is_definite mv -> (* avoids NULL *)
add lock set
else
| _ ->
set

let remove ((addr, _) as lock) set =
if Addr.is_definite addr then
match addr with
| Addr.Addr mv when Addr.Mval.is_definite mv -> (* avoids NULL *)
remove lock set
else
| _ ->
filter (fun (addr', _) ->
Addr.semantic_equal addr addr' = Some false
) set
Expand Down

0 comments on commit bd0468b

Please sign in to comment.