From cc9ee2cf1b205cc51a3a4f30c9f0a307e3b41ed1 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 7 Sep 2014 20:52:20 +0000 Subject: [PATCH] [PSEH] - Fix compilation of PSEH with Clang - Fix _SEH3$_InvokeEmbeddedFilterFromRegistration svn path=/trunk/; revision=64077 --- reactos/include/reactos/libs/pseh/pseh3.h | 2 +- reactos/lib/pseh/i386/pseh3.c | 12 +++++++----- reactos/lib/pseh/i386/pseh3_i386.S | 4 +++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index 457d7d93a27..6fbedc248ea 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -64,7 +64,7 @@ typedef struct _SEH3$_REGISTRATION_FRAME /* Except handler stores pointer to exception pointers here */ PSEH3$_EXCEPTION_POINTERS volatile ExceptionPointers; - /* Except handle stores the exception code here */ + /* Except handler stores the exception code here */ unsigned long ExceptionCode; /* Registers that we need to save */ diff --git a/reactos/lib/pseh/i386/pseh3.c b/reactos/lib/pseh/i386/pseh3.c index 8a3be57e03f..96760ea5b88 100644 --- a/reactos/lib/pseh/i386/pseh3.c +++ b/reactos/lib/pseh/i386/pseh3.c @@ -64,7 +64,7 @@ _SEH3$_Unregister( static inline LONG _SEH3$_InvokeNestedFunctionFilter( - PSEH3$_REGISTRATION_FRAME RegistrationFrame, + volatile SEH3$_REGISTRATION_FRAME *RegistrationFrame, PVOID Filter) { LONG FilterResult; @@ -93,17 +93,17 @@ _SEH3$_InvokeNestedFunctionFilter( long __attribute__((regparm(1))) _SEH3$_InvokeEmbeddedFilter( - PSEH3$_REGISTRATION_FRAME RegistrationFrame); + volatile SEH3$_REGISTRATION_FRAME *RegistrationFrame); long __attribute__((regparm(1))) _SEH3$_InvokeEmbeddedFilterFromRegistration( - PSEH3$_REGISTRATION_FRAME RegistrationFrame); + volatile SEH3$_REGISTRATION_FRAME *RegistrationFrame); static inline LONG _SEH3$_InvokeFilter( - PSEH3$_REGISTRATION_FRAME RegistrationFrame, + volatile SEH3$_REGISTRATION_FRAME *RegistrationFrame, PVOID Filter) { LONG FilterResult; @@ -133,7 +133,7 @@ _SEH3$_InvokeFilter( void __attribute__((regparm(1))) _SEH3$_AutoCleanup( - SEH3$_REGISTRATION_FRAME *Frame) + volatile SEH3$_REGISTRATION_FRAME *Frame) { /* Check for __finally frames */ if (Frame->ScopeTable->Target == NULL) @@ -241,7 +241,9 @@ _SEH3$_CallRtlUnwind( EXCEPTION_DISPOSITION __cdecl +#ifndef __clang__ __attribute__ ((__target__ ("cld"))) +#endif _SEH3$_except_handler( struct _EXCEPTION_RECORD * ExceptionRecord, PSEH3$_REGISTRATION_FRAME EstablisherFrame, diff --git a/reactos/lib/pseh/i386/pseh3_i386.S b/reactos/lib/pseh/i386/pseh3_i386.S index 8e409fa2406..adab89cec46 100644 --- a/reactos/lib/pseh/i386/pseh3_i386.S +++ b/reactos/lib/pseh/i386/pseh3_i386.S @@ -128,6 +128,8 @@ __SEH3$_InvokeEmbeddedFilterFromRegistration: mov edi, [eax + SEH3_REGISTRATION_FRAME_Edi] mov ebp, [eax + SEH3_REGISTRATION_FRAME_Ebp] + jmp __SEH3$_InvokeEmbeddedFilter2 + /* Get the saved stack pointer */ mov edx, [eax + SEH3_REGISTRATION_FRAME_Esp] @@ -155,7 +157,7 @@ __SEH3$_InvokeEmbeddedFilter: /* Load ebp from the registration invocation */ mov ebp, [eax + SEH3_REGISTRATION_FRAME_Ebp] - +__SEH3$_InvokeEmbeddedFilter2: /* Calculate the size of the temp stack frame region */ mov ecx, [eax + SEH3_REGISTRATION_FRAME_AllocaFrame] sub ecx, [eax + SEH3_REGISTRATION_FRAME_Esp]