Commit c21780a2 authored by Ted Kremenek's avatar Ted Kremenek
Browse files

Merge in analyzer fix r167762, which was a recent regression.

llvm-svn: 167776
parent 5be7a777
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;

+16 −0
Original line number Diff line number Diff line
@@ -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;
}