Added skeleton checking for NSString's method initWithFormat: (do not pass nil). This won't be useful in most cases right now

because the analyzer isn't tracking expected types for an object, and [NSString alloc] just runs "id".

llvm-svn: 48917
This commit is contained in:
Ted Kremenek 2008-03-28 16:09:38 +00:00
parent a148acdc82
commit c719424caa
1 changed files with 12 additions and 3 deletions

View File

@ -210,12 +210,21 @@ bool BasicObjCFoundationChecks::AuditNSString(NodeTy* N,
default:
break;
case 8:
if (!strcmp(cstr, "compare:"))
return CheckNilArg(N, 0);
break;
case 15:
// FIXME: Checking for initWithFormat: will not work in most cases
// yet because [NSString alloc] returns id, not NSString*. We will
// need support for tracking expected-type information in the analyzer
// to find these errors.
if (!strcmp(cstr, "initWithFormat:"))
return CheckNilArg(N, 0);
break;
case 16:
if (!strcmp(cstr, "compare:options:"))
return CheckNilArg(N, 0);