mirror of
https://github.com/reactos/reactos.git
synced 2026-05-24 00:00:41 +08:00
pseh2_64 relied on inline-asm clobbers across a C/asm funclet jump, which is not a reliable ABI boundary. On AMD64 gcc path, this can corrupt non-volatile state during exception filtering/unwind. This change makes the trampoline ABI-safe by explicitly preserving and restoring non-volatile registers and keeping unwind metadata/prologue consistent. Changes: - Save/restore rbx, rdi, rsi, r12-r15 in `__seh2_global_filter_func`. - Adjust stack allocation/unwind annotation to match the new prologue/epilogue. - Keep filter return in eax and jump back through `__seh2_global_filter_func_exit`. Note: This is exception-only path: extra stack usage is acceptable for correctness. How to test: Build and run ReactOS with gcc 13/15; you should no longer see stack exhaustion.