[PATCH] D86854: [CodeGen] Make sure the EH cleanup for block captures is conditional when the block literal is in a conditional context

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 30 22:58:56 PDT 2020


rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.

LGTM modulo the minor fix



================
Comment at: clang/lib/CodeGen/CGDecl.cpp:2107
+    // FIXME: When popping normal cleanups, we need to keep this EH cleanup
+    // around in case a temporary's destructor throws an exception.
+    if (cleanupKind & EHCleanup)
----------------
Oh, yuck, that's unfortunate.


================
Comment at: clang/lib/CodeGen/CGDecl.cpp:2117
+
+  // Otherwise, we should only destroy the object if its been initialized.
+  // Re-use the active flag and saved address across both the EH and end of
----------------
"it's"


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

https://reviews.llvm.org/D86854



More information about the cfe-commits mailing list