|
|
|
@ -860,6 +860,13 @@ struct
|
|
|
|
|
CTrans_utils.builtin_trans trans_state_pri sil_loc si function_type callee_pname_opt with
|
|
|
|
|
| Some builtin -> builtin
|
|
|
|
|
| None ->
|
|
|
|
|
(* Translate call to __builtin_expect as the first argument *)
|
|
|
|
|
(* for simpler symbolic execution *)
|
|
|
|
|
match callee_pname_opt, result_trans_subexprs with
|
|
|
|
|
| Some pname, [_; fst_arg_res; _]
|
|
|
|
|
when Procname.to_string pname = CFrontend_config.builtin_expect ->
|
|
|
|
|
fst_arg_res
|
|
|
|
|
| _ ->
|
|
|
|
|
let res_trans_call =
|
|
|
|
|
match cast_trans context act_params sil_loc callee_pname_opt function_type with
|
|
|
|
|
| Some (instr, cast_exp) ->
|
|
|
|
@ -867,20 +874,18 @@ struct
|
|
|
|
|
instrs = [instr];
|
|
|
|
|
exps = [(cast_exp, function_type)]; }
|
|
|
|
|
| None ->
|
|
|
|
|
let call_flags = { Sil.cf_default with Sil.cf_is_objc_block = is_call_to_block; } in
|
|
|
|
|
create_call_instr trans_state function_type sil_fe act_params sil_loc call_flags
|
|
|
|
|
~is_objc_method:false in
|
|
|
|
|
let call_flags =
|
|
|
|
|
{ Sil.cf_default with Sil.cf_is_objc_block = is_call_to_block; } in
|
|
|
|
|
create_call_instr trans_state function_type sil_fe act_params sil_loc
|
|
|
|
|
call_flags ~is_objc_method:false in
|
|
|
|
|
let nname = "Call "^(Sil.exp_to_string sil_fe) in
|
|
|
|
|
let all_res_trans = result_trans_subexprs @ [res_trans_call] in
|
|
|
|
|
let res_trans_to_parent =
|
|
|
|
|
PriorityNode.compute_results_to_parent trans_state_pri sil_loc nname si all_res_trans in
|
|
|
|
|
let res_trans_to_parent = PriorityNode.compute_results_to_parent trans_state_pri
|
|
|
|
|
sil_loc nname si all_res_trans in
|
|
|
|
|
(match callee_pname_opt with
|
|
|
|
|
| Some callee_pname ->
|
|
|
|
|
let open CContext in
|
|
|
|
|
if not (Builtin.is_registered callee_pname) then
|
|
|
|
|
begin
|
|
|
|
|
Cg.add_edge context.cg procname callee_pname;
|
|
|
|
|
end
|
|
|
|
|
Cg.add_edge context.CContext.cg procname callee_pname
|
|
|
|
|
| None -> ());
|
|
|
|
|
{ res_trans_to_parent with exps = res_trans_call.exps }
|
|
|
|
|
|
|
|
|
|