On Monday 19 January 2026 17:15:41 LIU Hao wrote:
> 在 2025-12-26 07:33, Pali Rohár 写道:
> > Both handlers are now same, just have different format of input parameters
> > and output return value. This removes code duplicity.
> > ---
> >   mingw-w64-crt/crt/crt_handler.c | 100 +++++---------------------------
> >   1 file changed, 13 insertions(+), 87 deletions(-)
> > 
> > diff --git a/mingw-w64-crt/crt/crt_handler.c 
> > b/mingw-w64-crt/crt/crt_handler.c
> > index e57d22ccb24c..6dc04f7217d2 100644
> > --- a/mingw-w64-crt/crt/crt_handler.c
> > +++ b/mingw-w64-crt/crt/crt_handler.c
> > @@ -185,96 +185,22 @@ _gnu_exception_handler (EXCEPTION_POINTERS 
> > *exception_data);
> >   long CALLBACK
> >   _gnu_exception_handler (EXCEPTION_POINTERS *exception_data)
> >   {
> > -  void (*old_handler) (int);
> > -  long action = EXCEPTION_CONTINUE_SEARCH;
> > -  int reset_fpu = 0;
> > -
> > -#ifdef __SEH__
> > -  if ((exception_data->ExceptionRecord->ExceptionCode & 0x20ffffff) == 
> > GCC_MAGIC)
> > +  EXCEPTION_DISPOSITION action = __mingw_SEH_error_handler 
> > (exception_data->ExceptionRecord,
> > +                                                            NULL /* 
> > EstablisherFrame is unavailable */,
> > +                                                            
> > exception_data->ContextRecord,
> > +                                                            NULL /* 
> > DispatcherContext is unavailable */);
> 
> Is this a good thing to do? I think that one should not pass a null pointer
> for `EstablisherFrame`, even if it's known that
> `__mingw_SEH_error_handler()` doesn't use this parameter.
> 
> So this probably should be the other way around -- to call
> `_gnu_exception_handler()` in `__mingw_SEH_error_handler()`.

With all those changes, the _gnu_exception_handler() is not needed or used.

So based on the fact that __mingw_SEH_error_handler does not use those
arguments and is ready to be removed, I chose the option to implement
_gnu_exception_handler() around __mingw_SEH_error_handler() as an
intermediate step until it is completely removed.


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

Reply via email to