Partially revert patch from 2014-03-04.
* exception.h (exception::handler_installed): Declare. (exception::exception): Install vectored exception handler on x86_64. (exception::~exception): Remove for x86_64. * exceptions.cc (exception::handler_installed): Define.
This commit is contained in:
@ -109,6 +109,7 @@ extern exception_list *_except_list asm ("%fs:0");
|
||||
class exception
|
||||
{
|
||||
#ifdef __x86_64__
|
||||
static bool handler_installed;
|
||||
static int handle (LPEXCEPTION_POINTERS);
|
||||
#else
|
||||
exception_list el;
|
||||
@ -119,16 +120,11 @@ public:
|
||||
exception () __attribute__ ((always_inline))
|
||||
{
|
||||
#ifdef __x86_64__
|
||||
/* Manually install SEH handler. */
|
||||
asm (".l_startframe: \n\
|
||||
.seh_handler __C_specific_handler, @except \n\
|
||||
.seh_handlerdata \n\
|
||||
.long 1 \n\
|
||||
.rva .l_startframe, \
|
||||
.l_endframe, \
|
||||
_ZN9exception6handleEP19_EXCEPTION_POINTERS, \
|
||||
.l_endframe \n\
|
||||
.text \n");
|
||||
if (!handler_installed)
|
||||
{
|
||||
handler_installed = true;
|
||||
AddVectoredExceptionHandler (1, handle);
|
||||
}
|
||||
#else
|
||||
save = _except_list;
|
||||
el.handler = handle;
|
||||
@ -136,13 +132,7 @@ public:
|
||||
_except_list = ⪙
|
||||
#endif /* __x86_64__ */
|
||||
};
|
||||
#ifdef __x86_64__
|
||||
~exception () __attribute__ ((always_inline)) {
|
||||
asm (" nop \n\
|
||||
.l_endframe: \n\
|
||||
nop \n");
|
||||
}
|
||||
#else
|
||||
#ifndef __x86_64__
|
||||
~exception () __attribute__ ((always_inline)) { _except_list = save; }
|
||||
#endif /* !__x86_64__ */
|
||||
};
|
||||
|
Reference in New Issue
Block a user