if (!rhsQI && !rhsQID && !rhsID)
return false;
- unsigned numRhsProtocols;
+ unsigned numRhsProtocols = 0;
ObjcProtocolDecl **rhsProtoList;
if (rhsQI) {
numRhsProtocols = rhsQI->getNumProtocols();
if (!lhsQI && !lhsQID && !lhsID)
return false;
- unsigned numLhsProtocols;
+ unsigned numLhsProtocols = 0;
ObjcProtocolDecl **lhsProtoList;
if (lhsQI) {
numLhsProtocols = lhsQI->getNumProtocols();
Expr *RExpr = static_cast<Expr *>(receiver);
QualType receiverType = RExpr->getType();
QualType returnType;
- ObjcMethodDecl *Method;
+ ObjcMethodDecl *Method = 0;
if (receiverType == Context.getObjcIdType() ||
receiverType == Context.getObjcClassType()) {
static_cast<PointerType*>(receiverType.getTypePtr());
receiverType = pointerType->getPointeeType();
}
- ObjcInterfaceDecl* ClassDecl;
+ ObjcInterfaceDecl* ClassDecl = 0;
if (ObjcQualifiedInterfaceType *QIT =
dyn_cast<ObjcQualifiedInterfaceType>(receiverType)) {
ClassDecl = QIT->getDecl();
}
if (!Method) {
// If we have an implementation in scope, check "private" methods.
- if (ObjcImplementationDecl *ImpDecl =
+ if (ClassDecl)
+ if (ObjcImplementationDecl *ImpDecl =
ObjcImplementations[ClassDecl->getIdentifier()])
- Method = ImpDecl->getInstanceMethod(Sel);
+ Method = ImpDecl->getInstanceMethod(Sel);
// If we still haven't found a method, look in the global pool. This
// behavior isn't very desirable, however we need it for GCC compatibility.
if (!Method)