================
@@ -316,11 +319,34 @@ void CIRGenFunction::popCleanupBlock() {
                              ? scope.getActiveFlag()
                              : Address::invalid();
 
-  bool requiresNormalCleanup = scope.isNormalCleanup();
+  // When deactivating, suppress normal cleanup emission. The cleanup should
+  // not fire on the normal exit path. EH cleanup is still needed so that
+  // exceptions during the body are handled.
+  bool requiresNormalCleanup = scope.isNormalCleanup() && !forDeactivation;
   bool requiresEHCleanup = scope.isEHCleanup();
 
+  // When deactivating a cleanup that still needs EH protection, downgrade
----------------
andykaylor wrote:

The comments were AI generated, but I've read them and edited some. They seem 
reasonable to me. This comment in particular is explaining something that was 
causing me problems during the development of this patch, so I thought an 
explanation was needed. Does it not make sense to you?

https://github.com/llvm/llvm-project/pull/191316
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to