From efd3aeccc659a16dde954b86793e01225994a177 Mon Sep 17 00:00:00 2001 From: Dulma Rodriguez Date: Wed, 17 Feb 2016 06:08:51 -0800 Subject: [PATCH] Using the attributes table to find out the method to call in virtual calls Reviewed By: cristianoc Differential Revision: D2932363 fb-gh-sync-id: 7c97bd1 shipit-source-id: 7c97bd1 --- infer/src/backend/symExec.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/infer/src/backend/symExec.ml b/infer/src/backend/symExec.ml index c0ba4d813..33e45dad9 100644 --- a/infer/src/backend/symExec.ml +++ b/infer/src/backend/symExec.ml @@ -595,8 +595,12 @@ let proc_desc_copy cfg pdesc pname pname' = let method_exists right_proc_name methods = if !Config.curr_language = Config.Java then IList.exists (fun meth_name -> Procname.equal right_proc_name meth_name) methods - else (* ObjC case *) - Specs.summary_exists right_proc_name + else (* ObjC/C++ case : The attribute map will only exist when we have code for the method or + the method has been called directly somewhere. It can still be that this is not the + case but we have a model for the method. *) + match AttributesTable.load_attributes right_proc_name with + | Some attrs -> attrs.ProcAttributes.is_defined + | None -> Specs.summary_exists_in_models right_proc_name let resolve_method tenv class_name proc_name = let found_class =