diff --git a/infer/src/clang/CType_decl.ml b/infer/src/clang/CType_decl.ml index 93e20e0d2..8904f6b99 100644 --- a/infer/src/clang/CType_decl.ml +++ b/infer/src/clang/CType_decl.ml @@ -769,6 +769,8 @@ module CProcname = struct name_info.Clang_ast_t.ni_name in objc_method_procname decl_info method_name mdi [] + | BlockDecl _ -> + Typ.Procname.Block (Typ.Procname.Block.make Config.anonymous_block_prefix []) | _ -> from_decl method_decl end diff --git a/infer/tests/codetoanalyze/objc/linters-for-test-only/issues.exp b/infer/tests/codetoanalyze/objc/linters-for-test-only/issues.exp index ba8383dae..8563b68c5 100644 --- a/infer/tests/codetoanalyze/objc/linters-for-test-only/issues.exp +++ b/infer/tests/codetoanalyze/objc/linters-for-test-only/issues.exp @@ -205,8 +205,8 @@ codetoanalyze/objc/linters-for-test-only/InContextOfMethodsTest.m, InContextOfMe codetoanalyze/objc/linters-for-test-only/InContextOfMethodsTest.m, InContextOfMethodsTest::method, 14, TEST_VAR_TYPE_CHECK, no_bucket, WARNING, [] codetoanalyze/objc/linters-for-test-only/InContextOfMethodsTest.m, function, 25, TEST_IN_FUNCTION_CONTEXT, no_bucket, WARNING, [] codetoanalyze/objc/linters-for-test-only/InContextOfMethodsTest.m, function, 25, TEST_VAR_TYPE_CHECK, no_bucket, WARNING, [] -codetoanalyze/objc/linters-for-test-only/InContextOfMethodsTest.m, objc_block_1, 19, TEST_VAR_TYPE_CHECK, no_bucket, WARNING, [] -codetoanalyze/objc/linters-for-test-only/InContextOfMethodsTest.m, objc_block_2, 19, TEST_IN_BLOCK_CONTEXT, no_bucket, WARNING, [] +codetoanalyze/objc/linters-for-test-only/InContextOfMethodsTest.m, objc_block, 19, TEST_IN_BLOCK_CONTEXT, no_bucket, WARNING, [] +codetoanalyze/objc/linters-for-test-only/InContextOfMethodsTest.m, objc_block, 19, TEST_VAR_TYPE_CHECK, no_bucket, WARNING, [] codetoanalyze/objc/linters-for-test-only/InSubclassExample.m, HappySadView2::makeBadAction, 33, IN_SUBCLASS_TEST, no_bucket, WARNING, [] codetoanalyze/objc/linters-for-test-only/PrivateAPIChecker.m, TestView::methoddd, 19, TEST_SELECTOR, no_bucket, WARNING, [] codetoanalyze/objc/linters-for-test-only/PrivateInstanceMethod.m, ClassWithPrivateMethods::_badMethod1, 51, UNNECESSARY_OBJC_INSTANCE_METHOD, no_bucket, ERROR, [] diff --git a/infer/tests/codetoanalyze/objc/linters/issues.exp b/infer/tests/codetoanalyze/objc/linters/issues.exp index ffa5a3532..8e28d300d 100644 --- a/infer/tests/codetoanalyze/objc/linters/issues.exp +++ b/infer/tests/codetoanalyze/objc/linters/issues.exp @@ -18,7 +18,7 @@ codetoanalyze/objc/linters/atomic_prop.m, A::readP, 77, POINTER_TO_INTEGRAL_IMPL codetoanalyze/objc/linters/atomic_prop.m, A::readQ, 85, DIRECT_ATOMIC_PROPERTY_ACCESS, no_bucket, WARNING, [] codetoanalyze/objc/linters/atomic_prop.m, A::readQ, 85, POINTER_TO_INTEGRAL_IMPLICIT_CAST, no_bucket, WARNING, [] codetoanalyze/objc/linters/atomic_prop.m, A::writeQ, 81, DIRECT_ATOMIC_PROPERTY_ACCESS, no_bucket, WARNING, [] -codetoanalyze/objc/linters/atomic_prop.m, objc_block_1, 113, DIRECT_ATOMIC_PROPERTY_ACCESS, no_bucket, WARNING, [] +codetoanalyze/objc/linters/atomic_prop.m, objc_block, 113, DIRECT_ATOMIC_PROPERTY_ACCESS, no_bucket, WARNING, [] codetoanalyze/objc/linters/badpointer.m, bad1, 15, BAD_POINTER_COMPARISON, no_bucket, WARNING, [] codetoanalyze/objc/linters/badpointer.m, bad10, 130, BAD_POINTER_COMPARISON, no_bucket, WARNING, [] codetoanalyze/objc/linters/badpointer.m, bad11, 139, BAD_POINTER_COMPARISON, no_bucket, WARNING, [] diff --git a/infer/tests/codetoanalyze/objcpp/linters-for-test-only/issues.exp b/infer/tests/codetoanalyze/objcpp/linters-for-test-only/issues.exp index d7d466dd7..cb8dab464 100644 --- a/infer/tests/codetoanalyze/objcpp/linters-for-test-only/issues.exp +++ b/infer/tests/codetoanalyze/objcpp/linters-for-test-only/issues.exp @@ -27,11 +27,11 @@ codetoanalyze/objcpp/linters-for-test-only/TestStructFieldChecks.mm, Linters_dum codetoanalyze/objcpp/linters-for-test-only/TestStructFieldChecks.mm, buttonComponent, 31, TITLE_NOT_INITIALIZED, no_bucket, WARNING, [] codetoanalyze/objcpp/linters-for-test-only/TestStructFieldChecks.mm, buttonComponent, 33, TITLE_NOT_INITIALIZED, no_bucket, WARNING, [] codetoanalyze/objcpp/linters-for-test-only/TestStructFieldChecks.mm, buttonComponent, 37, TITLE_NOT_INITIALIZED, no_bucket, WARNING, [] -codetoanalyze/objcpp/linters-for-test-only/componentblock.mm, objc_block_2, 48, OBJC_BLOCK_CAPTURING_VALUES, no_bucket, WARNING, [] -codetoanalyze/objcpp/linters-for-test-only/componentblock.mm, objc_block_3, 59, OBJC_BLOCK_CAPTURING_VALUES, no_bucket, WARNING, [] -codetoanalyze/objcpp/linters-for-test-only/componentblock.mm, objc_block_4, 71, OBJC_BLOCK_CAPTURING_VALUES, no_bucket, WARNING, [] -codetoanalyze/objcpp/linters-for-test-only/componentblock.mm, objc_block_5, 83, OBJC_BLOCK_CAPTURING_VALUES, no_bucket, WARNING, [] +codetoanalyze/objcpp/linters-for-test-only/componentblock.mm, objc_block, 48, OBJC_BLOCK_CAPTURING_VALUES, no_bucket, WARNING, [] +codetoanalyze/objcpp/linters-for-test-only/componentblock.mm, objc_block, 59, OBJC_BLOCK_CAPTURING_VALUES, no_bucket, WARNING, [] +codetoanalyze/objcpp/linters-for-test-only/componentblock.mm, objc_block, 71, OBJC_BLOCK_CAPTURING_VALUES, no_bucket, WARNING, [] +codetoanalyze/objcpp/linters-for-test-only/componentblock.mm, objc_block, 83, OBJC_BLOCK_CAPTURING_VALUES, no_bucket, WARNING, [] codetoanalyze/objcpp/linters-for-test-only/hash_test.mm, std::hash_NSObject_*_::operator(), 12, DISCOURAGED_HASH_METHOD_INVOCATION, no_bucket, WARNING, [] codetoanalyze/objcpp/linters-for-test-only/stateless.m, Linters_dummy_method, 21, ADHERE_TO_PROTOCOL, no_bucket, WARNING, [] codetoanalyze/objcpp/linters-for-test-only/stateless.m, Linters_dummy_method, 24, ONLY_ONE_CLASS_METHOD, no_bucket, WARNING, [] -codetoanalyze/objcpp/linters-for-test-only/static.m, objc_block_1, 18, OBJC_BLOCK_CAPTURING_VALUES, no_bucket, WARNING, [] +codetoanalyze/objcpp/linters-for-test-only/static.m, objc_block, 18, OBJC_BLOCK_CAPTURING_VALUES, no_bucket, WARNING, [] diff --git a/infer/tests/codetoanalyze/objcpp/linters/issues.exp b/infer/tests/codetoanalyze/objcpp/linters/issues.exp index 94cf263b0..7c5025655 100644 --- a/infer/tests/codetoanalyze/objcpp/linters/issues.exp +++ b/infer/tests/codetoanalyze/objcpp/linters/issues.exp @@ -4,8 +4,8 @@ codetoanalyze/objcpp/linters/componentkit/FactoryFunctionTest.mm, ExampleFunctio codetoanalyze/objcpp/linters/componentkit/InitializerWithSideEffectTest.mm, FooComponent::newDerp, 17, COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS, no_bucket, ADVICE, [] codetoanalyze/objcpp/linters/componentkit/InitializerWithSideEffectTest.mm, FooComponent::newDerp, 22, COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS, no_bucket, ADVICE, [] codetoanalyze/objcpp/linters/componentkit/InitializerWithSideEffectTest.mm, FooComponent::newDerp, 27, COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS, no_bucket, ADVICE, [] -codetoanalyze/objcpp/linters/componentkit/InitializerWithSideEffectTest.mm, objc_block_1, 35, COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS, no_bucket, ADVICE, [] -codetoanalyze/objcpp/linters/componentkit/InitializerWithSideEffectTest.mm, objc_block_2, 39, COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS, no_bucket, ADVICE, [] +codetoanalyze/objcpp/linters/componentkit/InitializerWithSideEffectTest.mm, objc_block, 35, COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS, no_bucket, ADVICE, [] +codetoanalyze/objcpp/linters/componentkit/InitializerWithSideEffectTest.mm, objc_block, 39, COMPONENT_INITIALIZER_WITH_SIDE_EFFECTS, no_bucket, ADVICE, [] codetoanalyze/objcpp/linters/componentkit/MultipleFactoryMethodsTest.h, Linters_dummy_method, 18, COMPONENT_WITH_MULTIPLE_FACTORY_METHODS, no_bucket, ADVICE, [] codetoanalyze/objcpp/linters/componentkit/MultipleFactoryMethodsTest.h, Linters_dummy_method, 30, COMPONENT_WITH_MULTIPLE_FACTORY_METHODS, no_bucket, ADVICE, [] codetoanalyze/objcpp/linters/componentkit/MultipleFactoryMethodsTest.h, Linters_dummy_method, 53, COMPONENT_WITH_MULTIPLE_FACTORY_METHODS, no_bucket, ADVICE, []