[clang] [CIR] Call std::terminate when __cxa_end_catch throws during unwinding (PR #245085)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 23 11:54:55 PST 2026
https://github.com/andykaylor commented:
There are a couple of problems with this approach.
First, it is implicitly introducing new semantics that don't exist in the earlier state of the CIR representation. The fact that an exception thrown from the EH cleanup handler will result in a call to terminate needs to be part of the semantic definition going back to the originally generated CIR. That can probably just be handled by documenting this as the semantics of `cir.cleanup_scope`. We also need to document that `cir.end_catch` may throw an exception.
Second, I think EHABILowering is the wrong place for this. It should be handled in FlattenCFG. That pass should give the EndCatch an unwind destination with a terminate just as it does for throwing dtors.
https://github.com/llvm/llvm-project/pull/245085
More information about the cfe-commits
mailing list