[PATCH] D45382: [CodeGen] Avoid destructing a struct type that has already been destructed by a delegated constructor

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 23 13:41:20 PDT 2018


rjmccall added inline comments.


================
Comment at: lib/CodeGen/CGCall.cpp:3069
+  if (hasAggregateEvaluationKind(type) &&
+      getContext().isParamDestroyedInCallee(type)) {
+    EHScopeStack::stable_iterator cleanup =
----------------
I wonder if this is something we should be taking from the CGFunctionInfo instead.  It does seem plausible that it could vary, e.g. according to the calling convention.  But maybe that's something we can handle in a separate patch?


================
Comment at: lib/CodeGen/CodeGenFunction.h:590
   class RunCleanupsScope {
-    EHScopeStack::stable_iterator CleanupStackDepth;
+    EHScopeStack::stable_iterator CleanupStackDepth, OldCleanupStackDepth;
     size_t LifetimeExtendedCleanupStackSize;
----------------
Please rename this variable to something like `OldCleanupScopeDepth`.


Repository:
  rC Clang

https://reviews.llvm.org/D45382





More information about the cfe-commits mailing list