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
if M.has_debug 1 then
begin
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 P.result "%t" print_outputs
end;
let new_state =
match lvaloption with
| None -> state_before_call
| 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_before_call
state_with_inputs stmt
~l_loc ~exact ~l_dpds ~l_decl
~r_dpds fct_dpds
in
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 (new_state, _num) =
try Lmap_bitwise.From_Model.fold process_out from_table (new_state, 1)
with Lmap_bitwise.From_Model.Cannot_fold ->
process_out Locations.Zone.top (false, Locations.Zone.top) (new_state, 1)
in new_state