On Fri May 16 20:43:23 2025 +0000, Alexandre Julliard wrote:
i know mingw has their crappy `__try1/__except1` macros, that doesn't
quite work like the real `__try/__except`. is there something that prevents us from improving upon them? Doing proper exception handling implies generating correct code range tables, and correct handler and unwinding code sequences, all of which depend on the code generated by the compiler. There's just no way to do that by injecting random asm statements inside the C code. The only way to do SEH without compiler support is by writing entire functions in assembly, which we've done in a few places for simple things, but obviously that doesn't scale.
I'm sure others know more, but my understanding is that GCC/mingw doesn't support Windows SEH, hence the need for the mingw macros and Wine's own support. Clang does support SEH, although it doesn't look like Wine uses it (`__TRY` always uses `WINE_FRAME` except on MSVC). If Wine's macros used real SEH on Clang, an ASan build could just require Clang be used for PE cross-compiling and you could ignore `WINE_FRAME`.