Loading clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,8 @@ static SVal adjustReturnValue(SVal V, QualType ExpectedTy, QualType ActualTy, return V; // If the types already match, don't do any unnecessary work. ExpectedTy = ExpectedTy.getCanonicalType(); ActualTy = ActualTy.getCanonicalType(); if (ExpectedTy == ActualTy) return V; Loading clang/test/Analysis/retain-release-inline.m +16 −0 Original line number Diff line number Diff line Loading @@ -343,5 +343,21 @@ void test_test_return_inline_2(char *bytes) { CFRelease(str); } extern CFStringRef getString(void); CFStringRef testCovariantReturnType(void) __attribute__((cf_returns_retained)); void usetestCovariantReturnType() { CFStringRef S = ((void*)0); S = testCovariantReturnType(); if (S) CFRelease(S); } CFStringRef testCovariantReturnType() { CFStringRef Str = ((void*)0); Str = getString(); if (Str) { CFRetain(Str); } return Str; } Loading
clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,8 @@ static SVal adjustReturnValue(SVal V, QualType ExpectedTy, QualType ActualTy, return V; // If the types already match, don't do any unnecessary work. ExpectedTy = ExpectedTy.getCanonicalType(); ActualTy = ActualTy.getCanonicalType(); if (ExpectedTy == ActualTy) return V; Loading
clang/test/Analysis/retain-release-inline.m +16 −0 Original line number Diff line number Diff line Loading @@ -343,5 +343,21 @@ void test_test_return_inline_2(char *bytes) { CFRelease(str); } extern CFStringRef getString(void); CFStringRef testCovariantReturnType(void) __attribute__((cf_returns_retained)); void usetestCovariantReturnType() { CFStringRef S = ((void*)0); S = testCovariantReturnType(); if (S) CFRelease(S); } CFStringRef testCovariantReturnType() { CFStringRef Str = ((void*)0); Str = getString(); if (Str) { CFRetain(Str); } return Str; }