diff --git a/infer/src/clang/ctl_parser_types.ml b/infer/src/clang/ctl_parser_types.ml index dfe8b2a4e..82cea8d34 100644 --- a/infer/src/clang/ctl_parser_types.ml +++ b/infer/src/clang/ctl_parser_types.ml @@ -73,6 +73,11 @@ let rec ast_node_name an = -> s | Stmt ObjCStringLiteral (_, [stmt], _) -> "@" ^ ast_node_name (Stmt stmt) + | Stmt ObjCBoxedExpr (_, [stmt], _, objc_boxed_expr_info) + -> let selector = + match objc_boxed_expr_info.obei_boxing_method with Some sel -> sel | None -> "" + in + selector ^ ast_node_name (Stmt stmt) | _ -> "" diff --git a/infer/tests/codetoanalyze/objc/linters/implicit_cast.m b/infer/tests/codetoanalyze/objc/linters/implicit_cast.m index 4909c0664..bf4d6fa69 100644 --- a/infer/tests/codetoanalyze/objc/linters/implicit_cast.m +++ b/infer/tests/codetoanalyze/objc/linters/implicit_cast.m @@ -62,4 +62,11 @@ typedef NS_ENUM(NSUInteger, MyEnum) { [self enum_param:@"s"]; } +- (void)param_int:(int)s { +} + +- (void)call_with_boxed_int { + [self param_int:@0]; +} + @end diff --git a/infer/tests/codetoanalyze/objc/linters/issues.exp b/infer/tests/codetoanalyze/objc/linters/issues.exp index 0e134ef10..05d4aaa1a 100644 --- a/infer/tests/codetoanalyze/objc/linters/issues.exp +++ b/infer/tests/codetoanalyze/objc/linters/issues.exp @@ -23,6 +23,7 @@ codetoanalyze/objc/linters/badpointer.m, bad6, 106, BAD_POINTER_COMPARISON, [] codetoanalyze/objc/linters/badpointer.m, bad7, 121, BAD_POINTER_COMPARISON, [] codetoanalyze/objc/linters/badpointer.m, bad8, 128, BAD_POINTER_COMPARISON, [] codetoanalyze/objc/linters/badpointer.m, bad9, 135, BAD_POINTER_COMPARISON, [] +codetoanalyze/objc/linters/implicit_cast.m, Implicit_cast_call_with_boxed_int, 69, POINTER_TO_INTEGRAL_IMPLICIT_CAST, [] codetoanalyze/objc/linters/implicit_cast.m, Implicit_cast_call_with_string, 62, POINTER_TO_INTEGRAL_IMPLICIT_CAST, [] codetoanalyze/objc/linters/implicit_cast.m, Implicit_cast_ivar_dictionary_item_call_funct_with_int, 47, POINTER_TO_INTEGRAL_IMPLICIT_CAST, [] codetoanalyze/objc/linters/implicit_cast.m, Implicit_cast_property_with_int, 51, POINTER_TO_INTEGRAL_IMPLICIT_CAST, []