let call_ouputs pdg state_before_call state_with_inputs stmt
lvaloption froms fct_dpds =
let froms_deps_return = froms.Function_Froms.deps_return in
let from_table = froms.Function_Froms.deps_table in
let print_outputs fmt =
Format.fprintf fmt "call outputs : %a"
Lmap_bitwise.From_Model.pretty from_table;
if not (lvaloption = None) then
Format.fprintf fmt "\t and \\result %a@."
Lmap_bitwise.From_Model.LOffset.pretty froms_deps_return
in
debug "%t" print_outputs;
let process_out out (default, from_out) (state, numout) =
let new_state =
BuildPdg.process_call_ouput pdg state_with_inputs state stmt
numout out default from_out fct_dpds in
(new_state, numout+1)
in
let (state_with_outputs, _num) =
try
Lmap_bitwise.From_Model.fold process_out from_table (state_before_call, 1)
with Lmap_bitwise.From_Model.Cannot_fold ->
process_out Locations.Zone.top (false, Locations.Zone.top)
(state_before_call, 1)
in
let new_state =
match lvaloption with
| None -> state_with_outputs
| Some lval ->
let r_dpds =
Lmap_bitwise.From_Model.LOffset.collapse froms_deps_return
in
let (l_loc, exact, l_dpds, l_decl) = get_lval_infos lval stmt in
BuildPdg.process_call_return
pdg
state_with_outputs
state_with_inputs stmt
~l_loc ~exact ~l_dpds ~l_decl
~r_dpds fct_dpds
in new_state