[infer][java] fail early on broken CFGs

Summary: Only in the case of Java to begin with

Reviewed By: jvillard

Differential Revision: D5476102

fbshipit-source-id: f7abd98
master
Jeremy Dubreil 7 years ago committed by Facebook Github Bot
parent bf11a27158
commit 9cf8d0fd3b

@ -80,10 +80,11 @@ let check_cfg_connectedness cfg =
match succs with [n'] when is_exit_node n' -> false | _ -> Int.equal (List.length preds) 0 match succs with [n'] when is_exit_node n' -> false | _ -> Int.equal (List.length preds) 0
in in
let do_pdesc pd = let do_pdesc pd =
let pname = Typ.Procname.to_string (Procdesc.get_proc_name pd) in let pname = Procdesc.get_proc_name pd in
let nodes = Procdesc.get_nodes pd in let nodes = Procdesc.get_nodes pd in
let broken = List.exists ~f:broken_node nodes in (* TODO (T20302015): also check the CFGs for the C-like procedures *)
if broken then L.internal_error "@\n ***BROKEN CFG: '%s'@\n" pname if not Config.keep_going && Typ.Procname.is_java pname && List.exists ~f:broken_node nodes then
failwithf "Broken CFG on %a" Typ.Procname.pp pname
in in
let pdescs = get_all_procs cfg in let pdescs = get_all_procs cfg in
List.iter ~f:do_pdesc pdescs List.iter ~f:do_pdesc pdescs

Loading…
Cancel
Save