[PATCH] D71491: [ubsan] Check implicit casts in ObjC for-in statements

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 26 12:36:03 PDT 2020


vsk marked 2 inline comments as done.
vsk added inline comments.


================
Comment at: clang/lib/CodeGen/CGObjC.cpp:1860
+          CGM.getObjCRuntime().GetClass(*this, InterfaceTy->getDecl());
+      Args.add(RValue::get(Cls), C.getObjCClassType());
+      llvm::Value *IsClass =
----------------
ahatanak wrote:
> It looks like `Args` should be cleared before adding the argument. Or should the argument be added to `IsKindOfClassArg`?
Thanks for catching this. The argument should be added to `IsKindOfClassArg`. This wasn't working correctly before: a leftover `%struct.__objcFastEnumerationState*` was included in the message-send. I've added a runtime test to ensure that the diagnostic does not fire when the implicit cast is correct.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71491





More information about the cfe-commits mailing list