[libunwind] Fix compilation errors (PR #159293)

Igor Popov via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 17 02:12:59 PDT 2025


https://github.com/silver-popov created https://github.com/llvm/llvm-project/pull/159293

Implicit conversion of int to enum causes an error in CLang 21.

>From d9fa0e0523476ef5b0a856379c99e3e9fa7b8613 Mon Sep 17 00:00:00 2001
From: Igor Popov <popov.nirvana at gmail.com>
Date: Wed, 17 Sep 2025 12:10:50 +0300
Subject: [PATCH] Fix compilation errors

---
 libunwind/src/Unwind-seh.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libunwind/src/Unwind-seh.cpp b/libunwind/src/Unwind-seh.cpp
index 8b83f10615f22..60571b3079887 100644
--- a/libunwind/src/Unwind-seh.cpp
+++ b/libunwind/src/Unwind-seh.cpp
@@ -163,7 +163,7 @@ _GCC_specific_handler(PEXCEPTION_RECORD ms_exc, PVOID frame, PCONTEXT ms_ctx,
     // If we were called by __libunwind_seh_personality(), indicate that
     // a handler was found; otherwise, initiate phase 2 by unwinding.
     if (ours && ms_exc->NumberParameters > 1)
-      return 4 /* ExceptionExecuteHandler in mingw */;
+      return (EXCEPTION_DISPOSITION)4 /* ExceptionExecuteHandler in mingw */;
     // This should never happen in phase 2.
     if (IS_UNWINDING(ms_exc->ExceptionFlags))
       _LIBUNWIND_ABORT("Personality indicated exception handler in phase 2!");
@@ -181,7 +181,7 @@ _GCC_specific_handler(PEXCEPTION_RECORD ms_exc, PVOID frame, PCONTEXT ms_ctx,
     // a handler was found; otherwise, it's time to initiate a collided
     // unwind to the target.
     if (ours && !IS_UNWINDING(ms_exc->ExceptionFlags) && ms_exc->NumberParameters > 1)
-      return 4 /* ExceptionExecuteHandler in mingw */;
+      return (EXCEPTION_DISPOSITION)4 /* ExceptionExecuteHandler in mingw */;
     // This should never happen in phase 1.
     if (!IS_UNWINDING(ms_exc->ExceptionFlags))
       _LIBUNWIND_ABORT("Personality installed context during phase 1!");



More information about the cfe-commits mailing list