From 432dd28731493a3c643c613b181199b9d6d8cd26 Mon Sep 17 00:00:00 2001 From: Dulma Rodriguez Date: Thu, 14 Jan 2016 09:45:49 -0800 Subject: [PATCH] Improving the line number information in the string delegate warning check Summary: public We are not assigning the location of the property rather than that of the class. It seems that it's no problem having the bugs reported in the .h files. Reviewed By: ddino Differential Revision: D2828005 fb-gh-sync-id: cf26549 --- infer/src/clang/cFrontend_checkers.ml | 4 ++-- infer/src/clang/cFrontend_errors.ml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/infer/src/clang/cFrontend_checkers.ml b/infer/src/clang/cFrontend_checkers.ml index cbd8ab552..ee9d8b087 100644 --- a/infer/src/clang/cFrontend_checkers.ml +++ b/infer/src/clang/cFrontend_checkers.ml @@ -14,7 +14,7 @@ open General_utils (* === Warnings on properties === *) (* Strong Delegate Warning: a property with name delegate should not be declared strong *) -let checker_strong_delegate_warning class_decl_info pname obj_c_property_decl_info = +let checker_strong_delegate_warning decl_info pname obj_c_property_decl_info = Printing.log_out "Checking for STRONG_DELEGATE property warning\n"; let delegate_regexp = Str.regexp_string_case_fold "delegate" in let pname_contains_delegate = try @@ -26,7 +26,7 @@ let checker_strong_delegate_warning class_decl_info pname obj_c_property_decl_in { name = "STRONG_DELEGATE_WARNING"; description = "Property or ivar "^pname.Clang_ast_t.ni_name^" declared strong"; suggestion = "In general delegates should be declared weak or assign"; - loc = CLocation.get_sil_location_from_range class_decl_info.Clang_ast_t.di_source_range true; + loc = CLocation.get_sil_location_from_range decl_info.Clang_ast_t.di_source_range true; } in (condition, warning_desc) diff --git a/infer/src/clang/cFrontend_errors.ml b/infer/src/clang/cFrontend_errors.ml index be4d9d0d6..9a000b2f3 100644 --- a/infer/src/clang/cFrontend_errors.ml +++ b/infer/src/clang/cFrontend_errors.ml @@ -40,7 +40,7 @@ let rec check_for_property_errors cfg cg tenv class_name class_decl_info decl_li let open Clang_ast_t in let do_one_property decl_info pname_info pdi = IList.iter (fun checker -> - let (condition, warning_desc) = checker class_decl_info pname_info pdi in + let (condition, warning_desc) = checker decl_info pname_info pdi in if condition then let proc_desc = CMethod_trans.get_method_for_frontend_checks cfg cg tenv class_name decl_info in