Merge in analyzer fix r167762, which was a recent regression.
authorTed Kremenek <kremenek@apple.com>
Mon, 12 Nov 2012 23:03:24 +0000 (23:03 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 12 Nov 2012 23:03:24 +0000 (23:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@167776 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
test/Analysis/retain-release-inline.m

index 3c1c412af536de5656ad785038e8f499e387b24b..5b88a454954962f7c80c0636ff502ab2c1d8f5bc 100644 (file)
@@ -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;
 
index a06b3531fea747f2ee872bfcfac17b61783260d2..6ff9e9a55264c34fb5d69069072b2d5b45858fb6 100644 (file)
@@ -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;
+}