[infer][java] fix inconsistent treatment of the --skip-implementation option

Summary: The code was previously inconsistent as passing the option was using an empty list of instructions to translate the code but still using the original JBIR representation to connect the nodes.

Reviewed By: sblackshear

Differential Revision: D5795903

fbshipit-source-id: 88c0e64
master
Jeremy Dubreil 7 years ago committed by Facebook Github Bot
parent 5b3c2c0901
commit 84f7732b21

@ -104,7 +104,10 @@ let add_cmethod source_file program linereader icfg cm proc_name =
| None | None
-> L.(die InternalError) "No exn node found for %s" (Typ.Procname.to_string proc_name) -> L.(die InternalError) "No exn node found for %s" (Typ.Procname.to_string proc_name)
in in
let instrs = if skip_implementation then Array.of_list [] else JBir.code jbir_code in if skip_implementation then
Procdesc.node_set_succs_exn procdesc start_node [exit_node] [exn_node]
else
let instrs = JBir.code jbir_code in
let context = JContext.create_context icfg procdesc jbir_code cn source_file program in let context = JContext.create_context icfg procdesc jbir_code cn source_file program in
let method_body_nodes = Array.mapi ~f:(JTrans.instruction context) instrs in let method_body_nodes = Array.mapi ~f:(JTrans.instruction context) instrs in
add_edges context start_node exn_node [exit_node] method_body_nodes jbir_code false add_edges context start_node exn_node [exit_node] method_body_nodes jbir_code false

Loading…
Cancel
Save