Skip to content

Commit 3ee6555

Browse files
Don't lure ourselves into a stupid trap. References #1343. References #1706
1 parent ae6b7d6 commit 3ee6555

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/analyses/mutexEventsAnalysis.ml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ struct
2121
let compute_refine_split (e: Addr.t) = match e with
2222
| Addr a ->
2323
let arg_e = AddrOf (PreValueDomain.Mval.to_cil a) in
24-
if not (CilType.Exp.equal arg arg_e) then
25-
let e' = BinOp (Eq, arg, arg_e, intType) in
26-
[Events.SplitBranch (e', true)]
27-
else
28-
[]
24+
(try
25+
(* Don't lure ourselves in a stupid trap *)
26+
let t = Cilfacade.typeOf arg_e in
27+
if not (CilType.Exp.equal arg arg_e) then
28+
let e' = BinOp (Eq, arg, arg_e, intType) in
29+
[Events.SplitBranch (e', true)]
30+
else
31+
[]
32+
with _ -> [])
2933
| _ -> []
3034
in
3135
match lv_opt with

0 commit comments

Comments
 (0)