[clang] [llvm] [WinEH] Fix try scopes leaking to caller on inline (PR #167176)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 3 14:29:51 PST 2025


================
@@ -1675,6 +1701,8 @@ void CodeGenFunction::EmitSEHTryStmt(const SEHTryStmt &S) {
       EmitRuntimeCallOrInvoke(getSehTryBeginFn(CGM));
       if (SEHTryEpilogueStack.size() == 1) // outermost only
         TryBB = Builder.GetInsertBlock();
+      if (!SehTryEndInvokeDest)
+        SehTryEndInvokeDest = getInvokeDest();
----------------
efriedma-quic wrote:

I'd prefer to store the destination alongside its corresponding cleanup, instead of sticking in a member of CodeGenFunction. Having it stored like this makes the interaction with nesting confusing.

https://github.com/llvm/llvm-project/pull/167176


More information about the llvm-commits mailing list