Skip to content
Snippets Groups Projects
Commit 6760006d authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[wp] fix dynamic calls per behaviors

parent 2fb08aa7
No related branches found
No related tags found
No related merge requests found
......@@ -209,7 +209,7 @@ let loop_step w = tag "InLoop" w
let call_dynamic _env _stmt _pid fct calls =
let u = node () in
Format.fprintf !out " %a [ color=red , label \"CallPtr %a\" ];@." pretty u
Format.fprintf !out " %a [ color=red , label=\"CallPtr %a\" ];@." pretty u
Printer.pp_exp fct ;
List.iter (fun (_,k) -> link u k) calls ; u
......
......@@ -129,7 +129,7 @@ let selected_main_bhv ~bhv ~prop (b : Cil_types.funbehavior) =
(* --- Calls --- *)
(* -------------------------------------------------------------------------- *)
let collect_calls ~bhv stmt =
let collect_calls ~bhv kf stmt =
let open Cil_types in
match stmt.skind with
| Instr(Call(_,fct,_,_)) ->
......@@ -137,7 +137,10 @@ let collect_calls ~bhv stmt =
match Kernel_function.get_called fct with
| Some kf -> Fset.singleton kf
| None ->
let bhvs = if bhv = [] then [Cil.default_behavior_name] else bhv in
let bhvs =
if bhv = []
then List.map (fun b -> b.b_name) (Annotations.behaviors kf)
else bhv in
List.fold_left
(fun fs bhv -> match Dyncall.get ~bhv stmt with
| None -> fs
......@@ -250,7 +253,7 @@ let compile Key.{ kf ; smoking ; bhv ; prop } =
(* Stmt Iteration *)
Shash.iter
(fun stmt (src,_) ->
let fs = collect_calls ~bhv stmt in
let fs = collect_calls ~bhv kf stmt in
let dead = unreachable infos src in
let ca = CfgAnnot.get_code_assertions kf stmt in
let ca_pids = List.map fst ca.code_verified in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment