Skip to content

Commit

Permalink
Fix mutex analysis postsolving crash on smtprc_comb.c
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Dec 27, 2022
1 parent 8ae3307 commit baa5b2d
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/analyses/mutexAnalysis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,19 @@ struct

if !GU.postsolving then (
let held_locks = (if write then snd else fst) (G.protecting (ctx.global (V.protecting v))) in
let vs_empty = VarSet.empty () in
Mutexes.iter (fun addr ->
let vs = VarSet.singleton v in
let protected =
if write then
(vs_empty, vs)
else
(vs, vs_empty)
in
ctx.sideg (V.protected addr) (G.create_protected protected)
) held_locks
if not (Mutexes.is_top held_locks) then (
let vs_empty = VarSet.empty () in
Mutexes.iter (fun addr ->
let vs = VarSet.singleton v in
let protected =
if write then
(vs_empty, vs)
else
(vs, vs_empty)
in
ctx.sideg (V.protected addr) (G.create_protected protected)
) held_locks
)
)
| None -> M.info ~category:Unsound "Write to unknown address: privatization is unsound."
in
Expand Down

0 comments on commit baa5b2d

Please sign in to comment.