Commit 5f9fcfb2 authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

Replace getAs with castAs to fix null dereference static analyzer warnings.

Use castAs as we know the cast should succeed (and castAs will assert if it doesn't) and we're dereferencing it directly in the canAssignObjCInterfaces call.
parent 3e53bf57
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8698,8 +8698,8 @@ bool ASTContext::areComparableObjCPointerTypes(QualType LHS, QualType RHS) {

bool ASTContext::canBindObjCObjectType(QualType To, QualType From) {
  return canAssignObjCInterfaces(
                getObjCObjectPointerType(To)->getAs<ObjCObjectPointerType>(),
                getObjCObjectPointerType(From)->getAs<ObjCObjectPointerType>());
      getObjCObjectPointerType(To)->castAs<ObjCObjectPointerType>(),
      getObjCObjectPointerType(From)->castAs<ObjCObjectPointerType>());
}

/// typesAreCompatible - C99 6.7.3p9: For two qualified types to be compatible,