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
2e4f0bc9
Commit
2e4f0bc9
authored
Oct 24, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use sigsetjmp instead of setjmp in Wine internal exception handlers to
make sure the signal mask is restored properly.
parent
f9f37beb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
fiber.c
dlls/kernel/fiber.c
+3
-3
exception.c
dlls/ntdll/exception.c
+1
-1
exception.h
include/wine/exception.h
+2
-2
No files found.
dlls/kernel/fiber.c
View file @
2e4f0bc9
...
@@ -39,7 +39,7 @@ struct fiber_data
...
@@ -39,7 +39,7 @@ struct fiber_data
void
*
stack_base
;
/* 08 top of fiber stack */
void
*
stack_base
;
/* 08 top of fiber stack */
void
*
stack_limit
;
/* 0c fiber stack low-water mark */
void
*
stack_limit
;
/* 0c fiber stack low-water mark */
void
*
stack_allocation
;
/* 10 base of the fiber stack allocation */
void
*
stack_allocation
;
/* 10 base of the fiber stack allocation */
jmp_buf
jmpbuf
;
/* 14 setjmp buffer (on Windows: CONTEXT) */
sigjmp_buf
jmpbuf
;
/* 14 setjmp buffer (on Windows: CONTEXT) */
DWORD
flags
;
/* fiber flags */
DWORD
flags
;
/* fiber flags */
LPFIBER_START_ROUTINE
start
;
/* start routine */
LPFIBER_START_ROUTINE
start
;
/* start routine */
};
};
...
@@ -185,7 +185,7 @@ void WINAPI SwitchToFiber( LPVOID fiber )
...
@@ -185,7 +185,7 @@ void WINAPI SwitchToFiber( LPVOID fiber )
/* stack_allocation and stack_base never change */
/* stack_allocation and stack_base never change */
/* FIXME: should save floating point context if requested in fiber->flags */
/* FIXME: should save floating point context if requested in fiber->flags */
if
(
!
s
etjmp
(
current_fiber
->
jmpbuf
))
if
(
!
s
igsetjmp
(
current_fiber
->
jmpbuf
,
1
))
{
{
NtCurrentTeb
()
->
Tib
.
u
.
FiberData
=
new_fiber
;
NtCurrentTeb
()
->
Tib
.
u
.
FiberData
=
new_fiber
;
NtCurrentTeb
()
->
Tib
.
ExceptionList
=
new_fiber
->
except
;
NtCurrentTeb
()
->
Tib
.
ExceptionList
=
new_fiber
->
except
;
...
@@ -195,6 +195,6 @@ void WINAPI SwitchToFiber( LPVOID fiber )
...
@@ -195,6 +195,6 @@ void WINAPI SwitchToFiber( LPVOID fiber )
if
(
new_fiber
->
start
)
/* first time */
if
(
new_fiber
->
start
)
/* first time */
wine_switch_to_stack
(
start_fiber
,
new_fiber
,
new_fiber
->
stack_base
);
wine_switch_to_stack
(
start_fiber
,
new_fiber
,
new_fiber
->
stack_base
);
else
else
longjmp
(
new_fiber
->
jmpbuf
,
1
);
sig
longjmp
(
new_fiber
->
jmpbuf
,
1
);
}
}
}
}
dlls/ntdll/exception.c
View file @
2e4f0bc9
...
@@ -394,7 +394,7 @@ DWORD __wine_exception_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION
...
@@ -394,7 +394,7 @@ DWORD __wine_exception_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION
RtlUnwind
(
frame
,
0
,
record
,
0
);
RtlUnwind
(
frame
,
0
,
record
,
0
);
__wine_pop_frame
(
frame
);
__wine_pop_frame
(
frame
);
longjmp
(
wine_frame
->
jmp
,
1
);
sig
longjmp
(
wine_frame
->
jmp
,
1
);
}
}
...
...
include/wine/exception.h
View file @
2e4f0bc9
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
__f.frame.Handler = __wine_exception_handler; \
__f.frame.Handler = __wine_exception_handler; \
__f.u.filter = (func); \
__f.u.filter = (func); \
__wine_push_frame( &__f.frame ); \
__wine_push_frame( &__f.frame ); \
if (s
etjmp( __f.jmp
)) { \
if (s
igsetjmp( __f.jmp, 1
)) { \
const __WINE_FRAME * const __eptr WINE_UNUSED = &__f; \
const __WINE_FRAME * const __eptr WINE_UNUSED = &__f; \
do {
do {
...
@@ -135,7 +135,7 @@ typedef struct __tagWINE_FRAME
...
@@ -135,7 +135,7 @@ typedef struct __tagWINE_FRAME
/* finally data */
/* finally data */
__WINE_FINALLY
finally_func
;
__WINE_FINALLY
finally_func
;
}
u
;
}
u
;
jmp_buf
jmp
;
sig
jmp_buf
jmp
;
/* hack to make GetExceptionCode() work in handler */
/* hack to make GetExceptionCode() work in handler */
DWORD
ExceptionCode
;
DWORD
ExceptionCode
;
const
struct
__tagWINE_FRAME
*
ExceptionRecord
;
const
struct
__tagWINE_FRAME
*
ExceptionRecord
;
...
...
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