Module: wine Branch: master Commit: e414561a96156b028f73b0cf223ccf3dc9ad3587 URL: https://gitlab.winehq.org/wine/wine/-/commit/e414561a96156b028f73b0cf223ccf3...
Author: Brendan Shanks bshanks@codeweavers.com Date: Thu Apr 20 14:39:42 2023 -0700
msvcrt: Fix crash when rethrowing after a non-C++ exception on x86_64.
---
dlls/msvcrt/except_x86_64.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/msvcrt/except_x86_64.c b/dlls/msvcrt/except_x86_64.c index d40b9985cd2..b07a7b83772 100644 --- a/dlls/msvcrt/except_x86_64.c +++ b/dlls/msvcrt/except_x86_64.c @@ -579,14 +579,14 @@ static DWORD cxx_frame_handler(EXCEPTION_RECORD *rec, ULONG64 frame, return ExceptionContinueSearch; }
+ if (rec->ExceptionCode == CXX_EXCEPTION && + (!rec->ExceptionInformation[1] && !rec->ExceptionInformation[2])) + { + TRACE("rethrow detected.\n"); + *rec = *msvcrt_get_thread_data()->exc_record; + } if (rec->ExceptionCode == CXX_EXCEPTION) { - if (!rec->ExceptionInformation[1] && !rec->ExceptionInformation[2]) - { - TRACE("rethrow detected.\n"); - *rec = *msvcrt_get_thread_data()->exc_record; - } - exc_type = (cxx_exception_type *)rec->ExceptionInformation[2];
if (TRACE_ON(seh))