opnsense-src/lib/Checker/BasicObjCFoundationChecks.cpp

560 lines
17 KiB
C++
Raw Normal View History

2009-06-02 13:58:47 -04:00
//== BasicObjCFoundationChecks.cpp - Simple Apple-Foundation checks -*- C++ -*--
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines BasicObjCFoundationChecks, a class that encapsulates
// a set of simple checks to run on Objective-C code using Apple's Foundation
// classes.
//
//===----------------------------------------------------------------------===//
#include "BasicObjCFoundationChecks.h"
2010-02-16 04:31:36 -05:00
#include "clang/Checker/PathSensitive/ExplodedGraph.h"
#include "clang/Checker/PathSensitive/GRSimpleAPICheck.h"
#include "clang/Checker/PathSensitive/GRExprEngine.h"
#include "clang/Checker/PathSensitive/GRState.h"
#include "clang/Checker/BugReporter/BugReporter.h"
#include "clang/Checker/PathSensitive/MemRegion.h"
#include "clang/Checker/BugReporter/PathDiagnostic.h"
#include "clang/Checker/PathSensitive/CheckerVisitor.h"
#include "clang/Checker/Checkers/LocalCheckers.h"
2009-06-02 13:58:47 -04:00
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/ASTContext.h"
using namespace clang;
2009-10-14 14:03:49 -04:00
static const ObjCInterfaceType* GetReceiverType(const ObjCMessageExpr* ME) {
const Expr* Receiver = ME->getReceiver();
2009-06-02 13:58:47 -04:00
if (!Receiver)
return NULL;
2009-10-14 14:03:49 -04:00
if (const ObjCObjectPointerType *PT =
Receiver->getType()->getAs<ObjCObjectPointerType>())
return PT->getInterfaceType();
2009-06-02 13:58:47 -04:00
return NULL;
}
2009-10-14 14:03:49 -04:00
static const char* GetReceiverNameType(const ObjCMessageExpr* ME) {
2009-10-23 10:22:18 -04:00
if (const ObjCInterfaceType *ReceiverType = GetReceiverType(ME))
return ReceiverType->getDecl()->getIdentifier()->getNameStart();
return NULL;
2009-06-02 13:58:47 -04:00
}
namespace {
2009-12-01 06:08:04 -05:00
class APIMisuse : public BugType {
2009-06-02 13:58:47 -04:00
public:
APIMisuse(const char* name) : BugType(name, "API Misuse (Apple)") {}
};
2009-10-14 14:03:49 -04:00
2009-12-01 06:08:04 -05:00
class BasicObjCFoundationChecks : public GRSimpleAPICheck {
2009-06-02 13:58:47 -04:00
APIMisuse *BT;
BugReporter& BR;
ASTContext &Ctx;
2009-10-14 14:03:49 -04:00
2009-10-23 10:22:18 -04:00
bool isNSString(const ObjCInterfaceType *T, llvm::StringRef suffix);
2009-10-14 14:03:49 -04:00
bool AuditNSString(ExplodedNode* N, const ObjCMessageExpr* ME);
void Warn(ExplodedNode* N, const Expr* E, const std::string& s);
void WarnNilArg(ExplodedNode* N, const Expr* E);
bool CheckNilArg(ExplodedNode* N, unsigned Arg);
2009-06-02 13:58:47 -04:00
public:
2009-10-14 14:03:49 -04:00
BasicObjCFoundationChecks(ASTContext& ctx, BugReporter& br)
2009-06-22 04:08:35 -04:00
: BT(0), BR(br), Ctx(ctx) {}
2009-10-14 14:03:49 -04:00
bool Audit(ExplodedNode* N, GRStateManager&);
private:
void WarnNilArg(ExplodedNode* N, const ObjCMessageExpr* ME, unsigned Arg) {
2009-06-02 13:58:47 -04:00
std::string sbuf;
llvm::raw_string_ostream os(sbuf);
os << "Argument to '" << GetReceiverNameType(ME) << "' method '"
<< ME->getSelector().getAsString() << "' cannot be nil.";
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// Lazily create the BugType object for NilArg. This will be owned
// by the BugReporter object 'BR' once we call BR.EmitWarning.
if (!BT) BT = new APIMisuse("nil argument");
2009-10-14 14:03:49 -04:00
2009-12-01 06:08:04 -05:00
RangedBugReport *R = new RangedBugReport(*BT, os.str(), N);
2009-06-02 13:58:47 -04:00
R->addRange(ME->getArg(Arg)->getSourceRange());
BR.EmitReport(R);
}
};
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
} // end anonymous namespace
GRSimpleAPICheck*
2009-06-22 04:08:35 -04:00
clang::CreateBasicObjCFoundationChecks(ASTContext& Ctx, BugReporter& BR) {
2009-10-14 14:03:49 -04:00
return new BasicObjCFoundationChecks(Ctx, BR);
2009-06-02 13:58:47 -04:00
}
2009-10-14 14:03:49 -04:00
bool BasicObjCFoundationChecks::Audit(ExplodedNode* N,
2009-06-02 13:58:47 -04:00
GRStateManager&) {
2009-10-14 14:03:49 -04:00
const ObjCMessageExpr* ME =
2009-06-02 13:58:47 -04:00
cast<ObjCMessageExpr>(cast<PostStmt>(N->getLocation()).getStmt());
2009-10-14 14:03:49 -04:00
const ObjCInterfaceType *ReceiverType = GetReceiverType(ME);
2009-06-02 13:58:47 -04:00
if (!ReceiverType)
return false;
2009-10-14 14:03:49 -04:00
2009-10-23 10:22:18 -04:00
if (isNSString(ReceiverType,
ReceiverType->getDecl()->getIdentifier()->getName()))
2009-06-02 13:58:47 -04:00
return AuditNSString(N, ME);
return false;
}
static inline bool isNil(SVal X) {
2009-10-14 14:03:49 -04:00
return isa<loc::ConcreteInt>(X);
2009-06-02 13:58:47 -04:00
}
//===----------------------------------------------------------------------===//
// Error reporting.
//===----------------------------------------------------------------------===//
2009-10-14 14:03:49 -04:00
bool BasicObjCFoundationChecks::CheckNilArg(ExplodedNode* N, unsigned Arg) {
const ObjCMessageExpr* ME =
2009-06-02 13:58:47 -04:00
cast<ObjCMessageExpr>(cast<PostStmt>(N->getLocation()).getStmt());
2009-10-14 14:03:49 -04:00
const Expr * E = ME->getArg(Arg);
2009-06-22 04:08:35 -04:00
if (isNil(N->getState()->getSVal(E))) {
2009-06-02 13:58:47 -04:00
WarnNilArg(N, ME, Arg);
return true;
}
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
return false;
}
//===----------------------------------------------------------------------===//
// NSString checking.
//===----------------------------------------------------------------------===//
2009-10-14 14:03:49 -04:00
bool BasicObjCFoundationChecks::isNSString(const ObjCInterfaceType *T,
2009-10-23 10:22:18 -04:00
llvm::StringRef ClassName) {
return ClassName == "NSString" || ClassName == "NSMutableString";
2009-06-02 13:58:47 -04:00
}
2009-10-14 14:03:49 -04:00
bool BasicObjCFoundationChecks::AuditNSString(ExplodedNode* N,
const ObjCMessageExpr* ME) {
2009-06-02 13:58:47 -04:00
Selector S = ME->getSelector();
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
if (S.isUnarySelector())
return false;
// FIXME: This is going to be really slow doing these checks with
// lexical comparisons.
2009-10-14 14:03:49 -04:00
2010-02-16 04:31:36 -05:00
std::string NameStr = S.getAsString();
llvm::StringRef Name(NameStr);
assert(!Name.empty());
// 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 (Name == "caseInsensitiveCompare:" ||
Name == "compare:" ||
Name == "compare:options:" ||
Name == "compare:options:range:" ||
Name == "compare:options:range:locale:" ||
Name == "componentsSeparatedByCharactersInSet:" ||
Name == "initWithFormat:")
return CheckNilArg(N, 0);
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
return false;
}
//===----------------------------------------------------------------------===//
// Error reporting.
//===----------------------------------------------------------------------===//
namespace {
2009-12-01 06:08:04 -05:00
class AuditCFNumberCreate : public GRSimpleAPICheck {
2009-06-02 13:58:47 -04:00
APIMisuse* BT;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// FIXME: Either this should be refactored into GRSimpleAPICheck, or
// it should always be passed with a call to Audit. The latter
// approach makes this class more stateless.
ASTContext& Ctx;
IdentifierInfo* II;
BugReporter& BR;
2009-06-22 04:08:35 -04:00
2009-06-02 13:58:47 -04:00
public:
2009-10-14 14:03:49 -04:00
AuditCFNumberCreate(ASTContext& ctx, BugReporter& br)
2009-06-22 04:08:35 -04:00
: BT(0), Ctx(ctx), II(&Ctx.Idents.get("CFNumberCreate")), BR(br){}
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
~AuditCFNumberCreate() {}
2009-10-14 14:03:49 -04:00
bool Audit(ExplodedNode* N, GRStateManager&);
2009-06-02 13:58:47 -04:00
private:
2009-10-14 14:03:49 -04:00
void AddError(const TypedRegion* R, const Expr* Ex, ExplodedNode *N,
uint64_t SourceSize, uint64_t TargetSize, uint64_t NumberKind);
2009-06-02 13:58:47 -04:00
};
} // end anonymous namespace
enum CFNumberType {
kCFNumberSInt8Type = 1,
kCFNumberSInt16Type = 2,
kCFNumberSInt32Type = 3,
kCFNumberSInt64Type = 4,
kCFNumberFloat32Type = 5,
kCFNumberFloat64Type = 6,
kCFNumberCharType = 7,
kCFNumberShortType = 8,
kCFNumberIntType = 9,
kCFNumberLongType = 10,
kCFNumberLongLongType = 11,
kCFNumberFloatType = 12,
kCFNumberDoubleType = 13,
kCFNumberCFIndexType = 14,
kCFNumberNSIntegerType = 15,
kCFNumberCGFloatType = 16
};
namespace {
template<typename T>
class Optional {
bool IsKnown;
T Val;
public:
Optional() : IsKnown(false), Val(0) {}
Optional(const T& val) : IsKnown(true), Val(val) {}
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
bool isKnown() const { return IsKnown; }
const T& getValue() const {
assert (isKnown());
return Val;
}
operator const T&() const {
return getValue();
}
};
}
static Optional<uint64_t> GetCFNumberSize(ASTContext& Ctx, uint64_t i) {
2010-01-01 05:34:51 -05:00
static const unsigned char FixedSize[] = { 8, 16, 32, 64, 32, 64 };
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
if (i < kCFNumberCharType)
return FixedSize[i-1];
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
QualType T;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
switch (i) {
case kCFNumberCharType: T = Ctx.CharTy; break;
case kCFNumberShortType: T = Ctx.ShortTy; break;
case kCFNumberIntType: T = Ctx.IntTy; break;
case kCFNumberLongType: T = Ctx.LongTy; break;
case kCFNumberLongLongType: T = Ctx.LongLongTy; break;
case kCFNumberFloatType: T = Ctx.FloatTy; break;
case kCFNumberDoubleType: T = Ctx.DoubleTy; break;
case kCFNumberCFIndexType:
case kCFNumberNSIntegerType:
case kCFNumberCGFloatType:
2009-10-14 14:03:49 -04:00
// FIXME: We need a way to map from names to Type*.
2009-06-02 13:58:47 -04:00
default:
return Optional<uint64_t>();
}
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
return Ctx.getTypeSize(T);
}
#if 0
static const char* GetCFNumberTypeStr(uint64_t i) {
static const char* Names[] = {
"kCFNumberSInt8Type",
"kCFNumberSInt16Type",
"kCFNumberSInt32Type",
"kCFNumberSInt64Type",
"kCFNumberFloat32Type",
"kCFNumberFloat64Type",
"kCFNumberCharType",
"kCFNumberShortType",
"kCFNumberIntType",
"kCFNumberLongType",
"kCFNumberLongLongType",
"kCFNumberFloatType",
"kCFNumberDoubleType",
"kCFNumberCFIndexType",
"kCFNumberNSIntegerType",
"kCFNumberCGFloatType"
};
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
return i <= kCFNumberCGFloatType ? Names[i-1] : "Invalid CFNumberType";
}
#endif
2009-10-14 14:03:49 -04:00
bool AuditCFNumberCreate::Audit(ExplodedNode* N,GRStateManager&){
const CallExpr* CE =
cast<CallExpr>(cast<PostStmt>(N->getLocation()).getStmt());
const Expr* Callee = CE->getCallee();
SVal CallV = N->getState()->getSVal(Callee);
2009-06-02 13:58:47 -04:00
const FunctionDecl* FD = CallV.getAsFunctionDecl();
if (!FD || FD->getIdentifier() != II || CE->getNumArgs()!=3)
return false;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// Get the value of the "theType" argument.
2009-06-22 04:08:35 -04:00
SVal TheTypeVal = N->getState()->getSVal(CE->getArg(1));
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// FIXME: We really should allow ranges of valid theType values, and
// bifurcate the state appropriately.
nonloc::ConcreteInt* V = dyn_cast<nonloc::ConcreteInt>(&TheTypeVal);
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
if (!V)
return false;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
uint64_t NumberKind = V->getValue().getLimitedValue();
Optional<uint64_t> TargetSize = GetCFNumberSize(Ctx, NumberKind);
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// FIXME: In some cases we can emit an error.
if (!TargetSize.isKnown())
return false;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// Look at the value of the integer being passed by reference. Essentially
// we want to catch cases where the value passed in is not equal to the
// size of the type being created.
2009-06-22 04:08:35 -04:00
SVal TheValueExpr = N->getState()->getSVal(CE->getArg(2));
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// FIXME: Eventually we should handle arbitrary locations. We can do this
// by having an enhanced memory model that does low-level typing.
loc::MemRegionVal* LV = dyn_cast<loc::MemRegionVal>(&TheValueExpr);
if (!LV)
return false;
2009-10-14 14:03:49 -04:00
2009-11-18 09:59:57 -05:00
const TypedRegion* R = dyn_cast<TypedRegion>(LV->StripCasts());
2009-10-14 14:03:49 -04:00
if (!R)
return false;
2009-06-02 13:58:47 -04:00
QualType T = Ctx.getCanonicalType(R->getValueType(Ctx));
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// FIXME: If the pointee isn't an integer type, should we flag a warning?
// People can do weird stuff with pointers.
2009-10-14 14:03:49 -04:00
if (!T->isIntegerType())
2009-06-02 13:58:47 -04:00
return false;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
uint64_t SourceSize = Ctx.getTypeSize(T);
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// CHECK: is SourceSize == TargetSize
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
if (SourceSize == TargetSize)
return false;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
AddError(R, CE->getArg(2), N, SourceSize, TargetSize, NumberKind);
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// FIXME: We can actually create an abstract "CFNumber" object that has
// the bits initialized to the provided values.
return SourceSize < TargetSize;
}
2009-10-14 14:03:49 -04:00
void AuditCFNumberCreate::AddError(const TypedRegion* R, const Expr* Ex,
ExplodedNode *N,
2009-06-02 13:58:47 -04:00
uint64_t SourceSize, uint64_t TargetSize,
uint64_t NumberKind) {
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
std::string sbuf;
llvm::raw_string_ostream os(sbuf);
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
os << (SourceSize == 8 ? "An " : "A ")
<< SourceSize << " bit integer is used to initialize a CFNumber "
"object that represents "
<< (TargetSize == 8 ? "an " : "a ")
2009-10-14 14:03:49 -04:00
<< TargetSize << " bit integer. ";
2009-06-02 13:58:47 -04:00
if (SourceSize < TargetSize)
os << (TargetSize - SourceSize)
2009-10-14 14:03:49 -04:00
<< " bits of the CFNumber value will be garbage." ;
2009-06-02 13:58:47 -04:00
else
os << (SourceSize - TargetSize)
<< " bits of the input integer will be lost.";
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
// Lazily create the BugType object. This will be owned
// by the BugReporter object 'BR' once we call BR.EmitWarning.
if (!BT) BT = new APIMisuse("Bad use of CFNumberCreate");
2009-12-01 06:08:04 -05:00
RangedBugReport *report = new RangedBugReport(*BT, os.str(), N);
2009-06-02 13:58:47 -04:00
report->addRange(Ex->getSourceRange());
BR.EmitReport(report);
}
GRSimpleAPICheck*
2009-10-14 14:03:49 -04:00
clang::CreateAuditCFNumberCreate(ASTContext& Ctx, BugReporter& BR) {
2009-06-22 04:08:35 -04:00
return new AuditCFNumberCreate(Ctx, BR);
2009-06-02 13:58:47 -04:00
}
2009-10-14 14:03:49 -04:00
//===----------------------------------------------------------------------===//
// CFRetain/CFRelease auditing for null arguments.
//===----------------------------------------------------------------------===//
namespace {
2009-12-01 06:08:04 -05:00
class AuditCFRetainRelease : public GRSimpleAPICheck {
2009-10-14 14:03:49 -04:00
APIMisuse *BT;
// FIXME: Either this should be refactored into GRSimpleAPICheck, or
// it should always be passed with a call to Audit. The latter
// approach makes this class more stateless.
ASTContext& Ctx;
IdentifierInfo *Retain, *Release;
BugReporter& BR;
public:
AuditCFRetainRelease(ASTContext& ctx, BugReporter& br)
: BT(0), Ctx(ctx),
Retain(&Ctx.Idents.get("CFRetain")), Release(&Ctx.Idents.get("CFRelease")),
BR(br){}
~AuditCFRetainRelease() {}
bool Audit(ExplodedNode* N, GRStateManager&);
};
} // end anonymous namespace
bool AuditCFRetainRelease::Audit(ExplodedNode* N, GRStateManager&) {
const CallExpr* CE = cast<CallExpr>(cast<PostStmt>(N->getLocation()).getStmt());
// If the CallExpr doesn't have exactly 1 argument just give up checking.
if (CE->getNumArgs() != 1)
return false;
// Check if we called CFRetain/CFRelease.
const GRState* state = N->getState();
SVal X = state->getSVal(CE->getCallee());
const FunctionDecl* FD = X.getAsFunctionDecl();
if (!FD)
return false;
const IdentifierInfo *FuncII = FD->getIdentifier();
if (!(FuncII == Retain || FuncII == Release))
return false;
// Finally, check if the argument is NULL.
// FIXME: We should be able to bifurcate the state here, as a successful
// check will result in the value not being NULL afterwards.
// FIXME: Need a way to register vistors for the BugReporter. Would like
// to benefit from the same diagnostics that regular null dereference
// reporting has.
if (state->getStateManager().isEqual(state, CE->getArg(0), 0)) {
if (!BT)
BT = new APIMisuse("null passed to CFRetain/CFRelease");
const char *description = (FuncII == Retain)
? "Null pointer argument in call to CFRetain"
: "Null pointer argument in call to CFRelease";
RangedBugReport *report = new RangedBugReport(*BT, description, N);
report->addRange(CE->getArg(0)->getSourceRange());
BR.EmitReport(report);
return true;
}
return false;
}
GRSimpleAPICheck*
clang::CreateAuditCFRetainRelease(ASTContext& Ctx, BugReporter& BR) {
return new AuditCFRetainRelease(Ctx, BR);
}
2009-12-01 06:08:04 -05:00
//===----------------------------------------------------------------------===//
// Check for sending 'retain', 'release', or 'autorelease' directly to a Class.
//===----------------------------------------------------------------------===//
namespace {
class ClassReleaseChecker :
public CheckerVisitor<ClassReleaseChecker> {
Selector releaseS;
Selector retainS;
Selector autoreleaseS;
Selector drainS;
BugType *BT;
public:
ClassReleaseChecker(ASTContext &Ctx)
: releaseS(GetNullarySelector("release", Ctx)),
retainS(GetNullarySelector("retain", Ctx)),
autoreleaseS(GetNullarySelector("autorelease", Ctx)),
drainS(GetNullarySelector("drain", Ctx)),
BT(0) {}
static void *getTag() { static int x = 0; return &x; }
void PreVisitObjCMessageExpr(CheckerContext &C, const ObjCMessageExpr *ME);
};
}
void ClassReleaseChecker::PreVisitObjCMessageExpr(CheckerContext &C,
const ObjCMessageExpr *ME) {
const IdentifierInfo *ClsName = ME->getClassName();
if (!ClsName)
return;
Selector S = ME->getSelector();
if (!(S == releaseS || S == retainS || S == autoreleaseS || S == drainS))
return;
if (!BT)
BT = new APIMisuse("message incorrectly sent to class instead of class "
"instance");
ExplodedNode *N = C.GenerateNode();
if (!N)
return;
llvm::SmallString<200> buf;
llvm::raw_svector_ostream os(buf);
os << "The '" << S.getAsString() << "' message should be sent to instances "
"of class '" << ClsName->getName()
<< "' and not the class directly";
RangedBugReport *report = new RangedBugReport(*BT, os.str(), N);
report->addRange(ME->getSourceRange());
C.EmitReport(report);
}
2009-06-02 13:58:47 -04:00
//===----------------------------------------------------------------------===//
// Check registration.
2009-10-14 14:03:49 -04:00
//===----------------------------------------------------------------------===//
2009-06-02 13:58:47 -04:00
2009-10-14 14:03:49 -04:00
void clang::RegisterAppleChecks(GRExprEngine& Eng, const Decl &D) {
2009-06-02 13:58:47 -04:00
ASTContext& Ctx = Eng.getContext();
BugReporter &BR = Eng.getBugReporter();
2009-06-22 04:08:35 -04:00
Eng.AddCheck(CreateBasicObjCFoundationChecks(Ctx, BR),
2009-06-02 13:58:47 -04:00
Stmt::ObjCMessageExprClass);
2009-10-14 14:03:49 -04:00
Eng.AddCheck(CreateAuditCFNumberCreate(Ctx, BR), Stmt::CallExprClass);
Eng.AddCheck(CreateAuditCFRetainRelease(Ctx, BR), Stmt::CallExprClass);
2009-06-02 13:58:47 -04:00
2009-10-14 14:03:49 -04:00
RegisterNSErrorChecks(BR, Eng, D);
2009-11-04 10:04:32 -05:00
RegisterNSAutoreleasePoolChecks(Eng);
2009-12-01 06:08:04 -05:00
Eng.registerCheck(new ClassReleaseChecker(Ctx));
2009-06-02 13:58:47 -04:00
}