eandrews added inline comments.

================
Comment at: clang/lib/CodeGen/CGObjC.cpp:222-223
   Selector Sel = MethodWithObjects->getSelector();
-  QualType ResultType = E->getType();
-  const ObjCObjectPointerType *InterfacePointerType
-    = ResultType->getAsObjCInterfacePointerType();
+  const ObjCObjectPointerType *InterfacePointerType =
+      cast<ObjCObjectPointerType>(E->getType());
   ObjCInterfaceDecl *Class
----------------
tahonermann wrote:
> The previous code included a guarantee that 
> `InterfacePointerType->getInterfaceType()` is non-null and this change loses 
> that assurance. Presumably, we never ran into a violation of that guarantee 
> in the past (since a SIGSEGV would likely have occurred below otherwise), but 
> perhaps we should consider an assertion to ensure that guarantee is still met.
Hmmm... I guess in that case it was just make more sense to keep the old code 
and add an assert for InterfacePointerType?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157454/new/

https://reviews.llvm.org/D157454

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to