[biabduction] Do not crash when Exe_env.get_tenv fails for some procedure

Reviewed By: da319

Differential Revision: D8332903

fbshipit-source-id: 4e4ae77
master
Dulma Churchill 7 years ago committed by Facebook Github Bot
parent 507de1e96c
commit 7f839ae962

@ -1106,7 +1106,15 @@ let add_missing_field_to_tenv ~missing_sigma exe_env caller_tenv callee_pname hp
let callee_attributes = Summary.get_attributes callee_summary in
(* if the callee is a model, then we don't have a tenv for it *)
if not callee_attributes.ProcAttributes.is_model && add_fields then
let callee_tenv = Exe_env.get_tenv exe_env callee_pname in
let callee_tenv_opt =
try Some (Exe_env.get_tenv exe_env callee_pname) with _ ->
let source_file = callee_attributes.ProcAttributes.loc.Location.file in
Tenv.load source_file
in
match callee_tenv_opt with
| None ->
()
| Some callee_tenv ->
let add_field_in_hpred hpred =
match hpred with
| Sil.Hpointsto (_, Sil.Estruct (_, _), Exp.Sizeof {typ= {desc= Typ.Tstruct name}}) -> (

Loading…
Cancel
Save