diff --git a/dlls/kernel/fiber.c b/dlls/kernel/fiber.c index 475c8b5dcb6..a5514477133 100644 --- a/dlls/kernel/fiber.c +++ b/dlls/kernel/fiber.c @@ -39,7 +39,7 @@ struct fiber_data void *stack_base; /* 08 top of fiber stack */ void *stack_limit; /* 0c fiber stack low-water mark */ 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 */ LPFIBER_START_ROUTINE start; /* start routine */ }; @@ -185,7 +185,7 @@ void WINAPI SwitchToFiber( LPVOID fiber ) /* stack_allocation and stack_base never change */ /* FIXME: should save floating point context if requested in fiber->flags */ - if (!setjmp( current_fiber->jmpbuf )) + if (!sigsetjmp( current_fiber->jmpbuf, 1 )) { NtCurrentTeb()->Tib.u.FiberData = new_fiber; NtCurrentTeb()->Tib.ExceptionList = new_fiber->except; @@ -195,6 +195,6 @@ void WINAPI SwitchToFiber( LPVOID fiber ) if (new_fiber->start) /* first time */ wine_switch_to_stack( start_fiber, new_fiber, new_fiber->stack_base ); else - longjmp( new_fiber->jmpbuf, 1 ); + siglongjmp( new_fiber->jmpbuf, 1 ); } } diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 6a22c615e7c..22e57857ff7 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -394,7 +394,7 @@ DWORD __wine_exception_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION RtlUnwind( frame, 0, record, 0 ); __wine_pop_frame( frame ); - longjmp( wine_frame->jmp, 1 ); + siglongjmp( wine_frame->jmp, 1 ); } diff --git a/include/wine/exception.h b/include/wine/exception.h index 2b383a146af..0b82c3a0d9c 100644 --- a/include/wine/exception.h +++ b/include/wine/exception.h @@ -89,7 +89,7 @@ __f.frame.Handler = __wine_exception_handler; \ __f.u.filter = (func); \ __wine_push_frame( &__f.frame ); \ - if (setjmp( __f.jmp)) { \ + if (sigsetjmp( __f.jmp, 1 )) { \ const __WINE_FRAME * const __eptr WINE_UNUSED = &__f; \ do { @@ -135,7 +135,7 @@ typedef struct __tagWINE_FRAME /* finally data */ __WINE_FINALLY finally_func; } u; - jmp_buf jmp; + sigjmp_buf jmp; /* hack to make GetExceptionCode() work in handler */ DWORD ExceptionCode; const struct __tagWINE_FRAME *ExceptionRecord;