[PATCH] D158233: [SEH] Fix wrong argument passes to the call of OutlinedFinally.

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 21 10:53:24 PDT 2023


rnk added inline comments.


================
Comment at: clang/lib/CodeGen/CGCleanup.cpp:882
       if (!Scope.hasBranchThroughs() && !HasFixups && !HasFallthrough &&
-          Scope.getNumBranchAfters() == 1) {
+          !getLangOpts().EHAsynch && Scope.getNumBranchAfters() == 1) {
         assert(!BranchThroughDest || !IsActive);
----------------
rnk wrote:
> This seems like it's only necessary when exiting a `__try` scope, but this check affects all exits from C++ cleanup scopes. Is there a way to check if there is an active try scope? When do we need to signal abnormal termination via normal control flow?
You can consider `usesSEHTry` , but it will require some type checking and casting: https://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html#a275d0f7f778c6ece58722aabde9b6d86


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158233



More information about the cfe-commits mailing list