[infer][java] quick patch to fix the assertion failure when the path of a context leak cannot be found

Reviewed By: sblackshear

Differential Revision: D5838766

fbshipit-source-id: a9e6b4a
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent d08bebe563
commit f8d04b4717

@ -538,15 +538,11 @@ let report_context_leaks pname sigma tenv =
List.iter List.iter
~f:(fun (context_exp, name) -> ~f:(fun (context_exp, name) ->
if Exp.Set.mem context_exp reachable_exps then if Exp.Set.mem context_exp reachable_exps then
let leak_path =
match get_fld_typ_path_opt fld_exps context_exp reachable_hpreds with match get_fld_typ_path_opt fld_exps context_exp reachable_hpreds with
| Some path
-> path
| None | None
-> assert false -> () (* TODO (T21871205): the underlying issue still need to be fixed *)
(* a path must exist in order for a leak to be reported *) | Some leak_path
in -> let err_desc =
let err_desc =
Errdesc.explain_context_leak pname (Typ.mk (Tstruct name)) fld_name leak_path Errdesc.explain_context_leak pname (Typ.mk (Tstruct name)) fld_name leak_path
in in
let exn = Exceptions.Context_leak (err_desc, __POS__) in let exn = Exceptions.Context_leak (err_desc, __POS__) in

Loading…
Cancel
Save