在 2025-12-26 07:33, Pali Rohár 写道:
__mingw_SEH_error_handler is processing only exceptions, not unwinds.
---
  mingw-w64-crt/crt/crt_handler.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/mingw-w64-crt/crt/crt_handler.c b/mingw-w64-crt/crt/crt_handler.c
index 56d844730fb1..51752b6dd641 100644
--- a/mingw-w64-crt/crt/crt_handler.c
+++ b/mingw-w64-crt/crt/crt_handler.c
@@ -85,6 +85,9 @@ __mingw_SEH_error_handler (struct _EXCEPTION_RECORD* 
ExceptionRecord,
    void (*old_handler) (int);
    int reset_fpu = 0;
+ if (ExceptionRecord->ExceptionFlags & (EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND))
+    return ExceptionContinueSearch;
+
    switch (ExceptionRecord->ExceptionCode)
      {
      case EXCEPTION_ACCESS_VIOLATION:

There's no need to check for `EXCEPTION_EXIT_UNWIND`, which is set (by calling `RtlUnwind()` with null target pointers) always also with `EXCEPTION_UNWINDING`. On ARM64 testing two bits and branching would require one extra instruction.



--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to