From be07b6db594d279a3391b7fb5af8048dcd78473b Mon Sep 17 00:00:00 2001
From: Peter Beutner
Date: Wed, 22 Feb 2006 12:06:56 +0100
Subject: [PATCH] msvcrt: Fix handling of multiple nested exceptions. Save in
each nested frame a pointer to the original exception record. Only one
refence in thread_data isn't enough when we have multiple nested frames.
---
dlls/msvcrt/cppexcept.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/cppexcept.c b/dlls/msvcrt/cppexcept.c
index d42e88ec247..3f28166740e 100644
--- a/dlls/msvcrt/cppexcept.c
+++ b/dlls/msvcrt/cppexcept.c
@@ -229,6 +229,7 @@ struct catch_func_nested_frame
cxx_exception_frame *cxx_frame; /* frame of parent exception */
cxx_function_descr *descr; /* descriptor of parent exception */
int trylevel; /* current try level */
+ EXCEPTION_RECORD *rec; /* rec associated with frame */
};
/* handler for exceptions happening while calling a catch function */
@@ -247,7 +248,7 @@ static DWORD catch_function_nested_handler( EXCEPTION_RECORD *rec, EXCEPTION_REG
if(rec->ExceptionCode == CXX_EXCEPTION)
{
- PEXCEPTION_RECORD prev_rec = msvcrt_get_thread_data()->exc_record;
+ PEXCEPTION_RECORD prev_rec = nested_frame->rec;
if(rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0)
{
/* exception was rethrown */
@@ -330,6 +331,7 @@ inline static void call_catch_block( PEXCEPTION_RECORD rec, cxx_exception_frame
nested_frame.cxx_frame = frame;
nested_frame.descr = descr;
nested_frame.trylevel = nested_trylevel + 1;
+ nested_frame.rec = rec;
__wine_push_frame( &nested_frame.frame );
thread_data->exc_record = rec;