Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ac9db113
Commit
ac9db113
authored
Jun 14, 2017
by
Daniel Lehman
Committed by
Alexandre Julliard
Jun 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Move exception rethrow handling to call_catch_block.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
19cb65b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
+25
-17
except_x86_64.c
dlls/msvcrt/except_x86_64.c
+25
-17
No files found.
dlls/msvcrt/except_x86_64.c
View file @
ac9db113
...
...
@@ -318,7 +318,18 @@ static void cxx_local_unwind(ULONG64 frame, DISPATCHER_CONTEXT *dispatch,
unwind_help
[
0
]
=
last_level
;
}
static
inline
void
*
WINAPI
call_catch_block
(
EXCEPTION_RECORD
*
rec
)
static
LONG
CALLBACK
cxx_rethrow_filter
(
PEXCEPTION_POINTERS
eptrs
)
{
EXCEPTION_RECORD
*
rec
=
eptrs
->
ExceptionRecord
;
if
(
rec
->
ExceptionCode
!=
CXX_EXCEPTION
)
return
EXCEPTION_CONTINUE_SEARCH
;
if
(
!
rec
->
ExceptionInformation
[
1
]
&&
!
rec
->
ExceptionInformation
[
2
])
return
EXCEPTION_EXECUTE_HANDLER
;
return
EXCEPTION_CONTINUE_SEARCH
;
}
static
void
*
WINAPI
call_catch_block
(
EXCEPTION_RECORD
*
rec
)
{
ULONG64
frame
=
rec
->
ExceptionInformation
[
1
];
const
cxx_function_descr
*
descr
=
(
void
*
)
rec
->
ExceptionInformation
[
2
];
...
...
@@ -326,13 +337,23 @@ static inline void* WINAPI call_catch_block(EXCEPTION_RECORD *rec)
void
*
(
__cdecl
*
handler
)(
ULONG64
unk
,
ULONG64
rbp
)
=
(
void
*
)
rec
->
ExceptionInformation
[
5
];
int
*
unwind_help
=
rva_to_ptr
(
descr
->
unwind_help
,
frame
);
cxx_frame_info
frame_info
;
void
*
ret_addr
;
void
*
ret_addr
=
NULL
;
TRACE
(
"calling handler %p
\n
"
,
handler
);
/* FIXME: native does local_unwind here in case of exception rethrow */
__CxxRegisterExceptionObject
(
&
prev_rec
,
&
frame_info
);
ret_addr
=
handler
(
0
,
frame
);
__TRY
{
ret_addr
=
handler
(
0
,
frame
);
}
__EXCEPT
(
cxx_rethrow_filter
)
{
TRACE
(
"detect rethrow: exception code: %x
\n
"
,
prev_rec
->
ExceptionCode
);
RaiseException
(
prev_rec
->
ExceptionCode
,
prev_rec
->
ExceptionFlags
,
prev_rec
->
NumberParameters
,
prev_rec
->
ExceptionInformation
);
}
__ENDTRY
__CxxUnregisterExceptionObject
(
&
frame_info
,
FALSE
);
unwind_help
[
0
]
=
-
2
;
unwind_help
[
1
]
=
-
1
;
...
...
@@ -548,19 +569,6 @@ static DWORD cxx_frame_handler(EXCEPTION_RECORD *rec, ULONG64 frame,
}
if
(
!
descr
->
tryblock_count
)
return
ExceptionContinueSearch
;
if
(
rec
->
ExceptionCode
==
CXX_EXCEPTION
&&
rec
->
ExceptionInformation
[
1
]
==
0
&&
rec
->
ExceptionInformation
[
2
]
==
0
)
{
*
rec
=
*
msvcrt_get_thread_data
()
->
exc_record
;
rec
->
ExceptionFlags
&=
~
EH_UNWINDING
;
if
(
TRACE_ON
(
seh
))
{
TRACE
(
"detect rethrow: exception code: %x
\n
"
,
rec
->
ExceptionCode
);
if
(
rec
->
ExceptionCode
==
CXX_EXCEPTION
)
TRACE
(
"re-propage: obj: %lx, type: %lx
\n
"
,
rec
->
ExceptionInformation
[
1
],
rec
->
ExceptionInformation
[
2
]);
}
}
if
(
rec
->
ExceptionCode
==
CXX_EXCEPTION
)
{
exc_type
=
(
cxx_exception_type
*
)
rec
->
ExceptionInformation
[
2
];
...
...
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