[llvm] [WinEH] Emit unreachable on malformed catchpad (PR #222181)

Aaron Danen via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 12:47:52 PDT 2026


================
@@ -58,6 +61,60 @@ static cl::opt<bool> DemoteCatchSwitchPHIOnlyOpt(
     "demote-catchswitch-only", cl::Hidden,
     cl::desc("Demote catchswitch BBs only (for wasm EH)"), cl::init(false));
 
+static bool isMalformedCatchpad(const CatchPadInst *CPI,
+                                EHPersonality Personality) {
+  switch (Personality) {
+  case EHPersonality::MSVC_CXX: {
+    if (CPI->arg_size() != 3)
+      return true;
+
+    Constant *TypeInfo;
+    GlobalVariable *TypeDescriptor;
+    ConstantInt *Adjectives;
----------------
aadanen wrote:

done

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


More information about the llvm-commits mailing list