Don't crash when a cg cannot be loaded.

Summary:
public This assert false causes the whole analysis to crash.
It is currently happening intermittently which makes it hard to debug.
Other inconsistencies don't cause the whole analysis to crash normally,
so this one seems to be too strict.

Reviewed By: cristianoc

Differential Revision: D2849864

fb-gh-sync-id: de6dce0
master
Dulma Rodriguez 9 years ago committed by facebook-github-bot-5
parent 2e7956f384
commit f34f2dcd98

@ -85,11 +85,14 @@ let add_active_proc exe_env proc_name =
(** like add_cg, but use exclude_fun to determine files to be excluded *)
let add_cg_exclude_fun (exe_env: t) (source_dir : DB.source_dir) exclude_fun =
let cg_fname = DB.source_dir_get_internal_file source_dir ".cg" in
let cg = match Cg.load_from_file cg_fname with
| None -> (L.err "cannot load %s@." (DB.filename_to_string cg_fname); assert false)
let cg_opt = match Cg.load_from_file cg_fname with
| None -> (L.stderr "cannot load %s@." (DB.filename_to_string cg_fname); None)
| Some cg ->
Cg.restrict_defined cg exe_env.active_opt;
cg in
Some cg in
match cg_opt with
| None -> None
| Some cg ->
let source = Cg.get_source cg in
if exclude_fun source then None
else

Loading…
Cancel
Save