[PATCH] D136639: [CodeGen][ObjC] Fix a memory leak that occurs when a non-trivial C struct property is set using dot notation

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 25 12:07:06 PDT 2022


rjmccall added inline comments.


================
Comment at: clang/test/CodeGenObjC/nontrivial-c-struct-property.m:89
+
+// CHECK: call void @__destructor_8_s0(ptr %[[AGG_TMP_ENSURED]])
+
----------------
It looks like we're copying `a` into a temporary and then copying out of that temporary into the argument slot.  I don't see any reason the extra copy is required.

Also, aren't non-trivial structs consumed as arguments?  If so, this would be an over-release.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136639



More information about the cfe-commits mailing list