[biabd] do not try to bypass `Ondemand` to get proc desc of models

Summary:
After some testing, it looks like getting the pdesc via
`Ondemand.get_proc_desc` will also load models' proc descs from their
summaries, so this code should not be needed.

Reviewed By: jeremydubreil, mbouaziz, martintrojer

Differential Revision: D9197176

fbshipit-source-id: 1b8603bfa
master
Jules Villard 6 years ago committed by Facebook Github Bot
parent 55c2188615
commit d9e12850b9

@ -719,28 +719,16 @@ let resolve_and_analyze tenv ~caller_pdesc ?(has_clang_model= false) prop args c
let analyze specialized_pdesc = Ondemand.analyze_proc_desc ~caller_pdesc specialized_pdesc in
let resolved_proc_desc_option =
match Ondemand.get_proc_desc resolved_pname with
| Some resolved_proc_desc ->
Some resolved_proc_desc
| Some _ as resolved_proc_desc ->
resolved_proc_desc
| None ->
let procdesc_opt =
(* If it is a model, we aim to get the procdesc stored in a summary rather than the
(empty) procdesc stored in the caller's cfg. *)
if has_clang_model then
match Summary.get callee_proc_name with
| Some summary ->
Some (Summary.get_proc_desc summary)
| None ->
Ondemand.get_proc_desc callee_proc_name
else Ondemand.get_proc_desc callee_proc_name
in
Option.map
~f:(fun callee_proc_desc ->
(* It is possible that the types of the arguments are not as precise as the type of the objects
in the heap, so we should update them to get the best results. *)
let procdesc_opt = Ondemand.get_proc_desc callee_proc_name in
Option.map procdesc_opt ~f:(fun callee_proc_desc ->
(* It is possible that the types of the arguments are not as precise as the type of
the objects in the heap, so we should update them to get the best results. *)
let resolved_args = resolve_args prop args in
Procdesc.specialize_types ~has_clang_model callee_proc_desc resolved_pname
resolved_args )
procdesc_opt
in
(resolved_proc_desc_option, Option.bind resolved_proc_desc_option ~f:analyze)
in

@ -72,7 +72,6 @@ codetoanalyze/objc/errors/subtyping/KindOfClassExample.m, shouldThrowDivideByZer
codetoanalyze/objc/errors/subtyping/KindOfClassExample.m, shouldThrowDivideByZero2, 2, DIVIDE_BY_ZERO, no_bucket, ERROR, [start of procedure shouldThrowDivideByZero2(),start of procedure init,return from a call to Base_init,start of procedure returnsZero2(),Taking false branch,return from a call to returnsZero2]
codetoanalyze/objc/errors/subtyping/KindOfClassExample.m, shouldThrowDivideByZero3, 3, DIVIDE_BY_ZERO, no_bucket, ERROR, [start of procedure shouldThrowDivideByZero3(),start of procedure init,return from a call to Derived_init,Taking true branch]
codetoanalyze/objc/errors/variadic_methods/premature_nil_termination.m, PrematureNilTermA_nilInArrayWithObjects, 5, PREMATURE_NIL_TERMINATION_ARGUMENT, B1, ERROR, [start of procedure nilInArrayWithObjects]
objc/src/CADisplayLink.m, CADisplayLink_displayLinkWithTarget:selector:, 3, Missing_fld, no_bucket, ERROR, [start of procedure displayLinkWithTarget:selector:]
codetoanalyze/objc/errors/memory_leaks_benchmark/CoreVideoExample.m, CoreVideoExample_cvpixelbuffer_not_released_leak, 1, MEMORY_LEAK, no_bucket, ERROR, [start of procedure cvpixelbuffer_not_released_leak]
codetoanalyze/objc/errors/memory_leaks_benchmark/NSData_models_tests.m, NSData_models_tests_macForIV:, 2, MEMORY_LEAK, no_bucket, ERROR, [start of procedure macForIV:]
codetoanalyze/objc/errors/memory_leaks_benchmark/NSString_models_tests.m, StringInitA_hexStringValue, 11, MEMORY_LEAK, no_bucket, ERROR, [start of procedure hexStringValue,Skipping CFStringCreateWithBytesNoCopy(): method has no implementation,Taking false branch]

Loading…
Cancel
Save