let check_called_marks new_call_marks ff_called =
let ff_marks = get_ff_marks ff_called in
let ff_pdg, _ = ff_marks in
let new_output = ref false in
let m2m s m = match s with
| PdgMarks.SelIn _ ->
(* let nkey = PdgIndex.Key.implicit_in_key l in *)
(* As we are looking for some call output node,
* even if the data is not entirely defined by the function,
* it has already been taken into account in the "from". *)
None
| PdgMarks.SelNode (n, _z_opt) ->
let nkey = !Db.Pdg.node_key n in
(*
let nkey = match z_opt with None -> nkey
| Some z -> match nkey with
| PdgIndex.Key.SigCallKey
(call_id, (PdgIndex.Signature.Out _)) ->
let call = PdgIndex.Key.call_from_id call_id in
PdgIndex.Key.call_output_key call z
| _ -> nkey
in
*)
let old_m = get_mark ff_marks nkey in
let m_opt = Marks.missing_output_mark ~call:m ~called:old_m in
let new_out = match m_opt with
| Some _new_m when Marks.is_bottom_mark old_m ->
new_output := true; true
| _ -> (); false
in
SlicingParameters.debug ~level:2 "[Fct_Slice.FctMarks.check_called_marks] for %a : old=%a new=%a -> %a %s"
!Db.Pdg.pretty_key nkey
Marks.pretty_mark old_m
Marks.pretty_mark m
Marks.pretty_mark
(match m_opt with None -> Marks.bottom_mark | Some m -> m)
(if new_out then "(new out)" else "");
m_opt
in let new_called_marks =
Pdg.Register.call_out_marks_to_called ff_pdg m2m new_call_marks
in new_called_marks, !new_output