Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
78ea87c5
Commit
78ea87c5
authored
Oct 30, 2005
by
Peter Beutner
Committed by
Alexandre Julliard
Oct 30, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix exception handling for non CXX_EXCEPTIONs.
parent
3585f2fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
27 deletions
+44
-27
cppexcept.c
dlls/msvcrt/cppexcept.c
+44
-27
No files found.
dlls/msvcrt/cppexcept.c
View file @
78ea87c5
...
...
@@ -260,13 +260,23 @@ inline static void *call_catch_block( PEXCEPTION_RECORD rec, cxx_exception_frame
for
(
j
=
0
;
j
<
tryblock
->
catchblock_count
;
j
++
)
{
catchblock_info
*
catchblock
=
&
tryblock
->
catchblock
[
j
];
const
cxx_type_info
*
type
=
find_caught_type
(
info
,
catchblock
);
if
(
!
type
)
continue
;
TRACE
(
"matched type %p in tryblock %d catchblock %d
\n
"
,
type
,
i
,
j
);
/* copy the exception to its destination on the stack */
copy_exception
(
object
,
frame
,
catchblock
,
type
);
if
(
info
)
{
const
cxx_type_info
*
type
=
find_caught_type
(
info
,
catchblock
);
if
(
!
type
)
continue
;
TRACE
(
"matched type %p in tryblock %d catchblock %d
\n
"
,
type
,
i
,
j
);
/* copy the exception to its destination on the stack */
copy_exception
(
object
,
frame
,
catchblock
,
type
);
}
else
{
/* no CXX_EXCEPTION only proceed with a catch(...) block*/
if
(
catchblock
->
type_info
)
continue
;
TRACE
(
"found catch(...) block
\n
"
);
}
/* unwind the stack */
RtlUnwind
(
frame
,
0
,
rec
,
0
);
...
...
@@ -274,8 +284,8 @@ inline static void *call_catch_block( PEXCEPTION_RECORD rec, cxx_exception_frame
frame
->
trylevel
=
tryblock
->
end_level
+
1
;
/* call the catch block */
TRACE
(
"calling catch block %p
for type %p
addr %p ebp %p
\n
"
,
catchblock
,
type
,
catchblock
->
handler
,
&
frame
->
ebp
);
TRACE
(
"calling catch block %p addr %p ebp %p
\n
"
,
catchblock
,
catchblock
->
handler
,
&
frame
->
ebp
);
/* setup an exception block for nested exceptions */
...
...
@@ -291,7 +301,7 @@ inline static void *call_catch_block( PEXCEPTION_RECORD rec, cxx_exception_frame
thread_data
->
exc_record
=
nested_frame
.
prev_rec
;
__wine_pop_frame
(
&
nested_frame
.
frame
);
if
(
info
->
destructor
)
call_dtor
(
info
->
destructor
,
object
);
if
(
info
&&
info
->
destructor
)
call_dtor
(
info
->
destructor
,
object
);
TRACE
(
"done, continuing at %p
\n
"
,
addr
);
return
addr
;
}
...
...
@@ -325,27 +335,34 @@ static DWORD cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* fram
}
if
(
!
descr
->
tryblock_count
)
return
ExceptionContinueSearch
;
exc_type
=
(
cxx_exception_type
*
)
rec
->
ExceptionInformation
[
2
];
if
(
rec
->
ExceptionCode
==
CXX_EXCEPTION
&&
rec
->
ExceptionInformation
[
0
]
>
CXX_FRAME_MAGIC
&&
exc_type
->
custom_handler
)
{
return
exc_type
->
custom_handler
(
rec
,
frame
,
exc_context
,
dispatch
,
descr
,
nested_trylevel
,
nested_frame
,
0
);
}
if
(
!
exc_type
)
/* nested exception, fetch info from original exception */
if
(
rec
->
ExceptionCode
==
CXX_EXCEPTION
)
{
rec
=
msvcrt_get_thread_data
()
->
exc_record
;
exc_type
=
(
cxx_exception_type
*
)
rec
->
ExceptionInformation
[
2
];
}
if
(
TRACE_ON
(
seh
))
if
(
rec
->
ExceptionInformation
[
0
]
>
CXX_FRAME_MAGIC
&&
exc_type
->
custom_handler
)
{
return
exc_type
->
custom_handler
(
rec
,
frame
,
exc_context
,
dispatch
,
descr
,
nested_trylevel
,
nested_frame
,
0
);
}
if
(
!
exc_type
)
/* nested exception, fetch info from original exception */
{
rec
=
msvcrt_get_thread_data
()
->
exc_record
;
exc_type
=
(
cxx_exception_type
*
)
rec
->
ExceptionInformation
[
2
];
}
if
(
TRACE_ON
(
seh
))
{
TRACE
(
"handling C++ exception rec %p frame %p trylevel %d descr %p nested_frame %p
\n
"
,
rec
,
frame
,
frame
->
trylevel
,
descr
,
nested_frame
);
dump_exception_type
(
exc_type
);
dump_function_descr
(
descr
,
exc_type
);
}
}
else
{
TRACE
(
"handling C++ exception rec %p frame %p trylevel %d descr %p nested_frame %p
\n
"
,
rec
,
frame
,
frame
->
trylevel
,
descr
,
nested_frame
);
dump_exception_type
(
exc_type
);
dump_function_descr
(
descr
,
exc_type
);
exc_type
=
NULL
;
TRACE
(
"handling C exception code %lx rec %p frame %p trylevel %d descr %p nested_frame %p
\n
"
,
rec
->
ExceptionCode
,
rec
,
frame
,
frame
->
trylevel
,
descr
,
nested_frame
);
}
next_ip
=
call_catch_block
(
rec
,
frame
,
descr
,
frame
->
trylevel
,
exc_type
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment