Index: cfe/trunk/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp =================================================================== --- cfe/trunk/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp +++ cfe/trunk/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp @@ -730,7 +730,7 @@ if (const auto *MD = dyn_cast(FD)) { for (const auto *OD : MD->overridden_methods()) { const ParmVarDecl *OP = OD->parameters()[parm_idx]; - if (applyFunctionParamAnnotationEffect(OP, parm_idx, MD, AF, Template)) + if (applyFunctionParamAnnotationEffect(OP, parm_idx, OD, AF, Template)) return true; } } Index: cfe/trunk/test/Analysis/osobject-retain-release.cpp =================================================================== --- cfe/trunk/test/Analysis/osobject-retain-release.cpp +++ cfe/trunk/test/Analysis/osobject-retain-release.cpp @@ -45,6 +45,8 @@ OSObject *identity() override; + virtual OSObject *generateObject(OSObject *input); + virtual void consumeReference(OS_CONSUME OSArray *other); static OSArray *generateArrayHasCode() { @@ -68,6 +70,8 @@ void consumeReference(OSArray *other) override; OSObject *identity() override; + + OSObject *generateObject(OSObject *input) override; }; struct OtherStruct { @@ -79,6 +83,14 @@ static OSObject *safeMetaCast(const OSObject *inst, const OSMetaClass *meta); }; +void test_no_infinite_check_recursion(MyArray *arr) { + OSObject *input = new OSObject; + OSObject *o = arr->generateObject(input); + o->release(); + input->release(); +} + + void check_param_attribute_propagation(MyArray *parent) { OSArray *arr = new OSArray; parent->consumeReference(arr);