Skip to content

Commit 3bbaece

Browse files
committed
Add extra arinc analysis activation checks to mutexEvents
1 parent f537abe commit 3bbaece

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/analyses/mutexEventsAnalysis.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ struct
7373
ctx.emit (Events.Lock (verifier_atomic, true))
7474

7575
let special (ctx: (unit, _, _, _) ctx) lv f arglist : D.t =
76+
let is_activated a = List.mem a (GobConfig.get_string_list "ana.activated") in (* TODO: proper LibraryFunctions group selection *)
7677
let remove_rw x = x in
7778
let unlock remove_fn =
7879
match f.vname, arglist with
@@ -82,7 +83,7 @@ struct
8283
ctx.split () [Events.Unlock (remove_fn e)]
8384
) (eval_exp_addr (Analyses.ask_of_ctx ctx) arg);
8485
raise Analyses.Deadcode
85-
| "LAP_Se_SignalSemaphore", [Lval arg; _] ->
86+
| "LAP_Se_SignalSemaphore", [Lval arg; _] when is_activated "arinc" || is_activated "extract_arinc" ->
8687
List.iter (fun e ->
8788
ctx.split () [Events.Unlock (remove_fn e)]
8889
) (eval_exp_addr (Analyses.ask_of_ctx ctx) (Cil.mkAddrOf arg));
@@ -101,7 +102,7 @@ struct
101102
| "spin_lock_irqsave", [arg; _] ->
102103
(*print_endline @@ "Mutex `Lock "^f.vname;*)
103104
lock ctx rw failing nonzero_return_when_aquired (Analyses.ask_of_ctx ctx) lv arg
104-
| "LAP_Se_WaitSemaphore", [Lval arg; _; _] ->
105+
| "LAP_Se_WaitSemaphore", [Lval arg; _; _] when is_activated "arinc" || is_activated "extract_arinc" ->
105106
(*print_endline @@ "Mutex `Lock "^f.vname;*)
106107
lock ctx rw failing nonzero_return_when_aquired (Analyses.ask_of_ctx ctx) lv (Cil.mkAddrOf arg)
107108
| _ -> failwith "lock has multiple arguments"

0 commit comments

Comments
 (0)