Author: hyperion
Date: Tue Dec 30 14:02:03 2008
New Revision: 38476
URL:
http://svn.reactos.org/svn/reactos?rev=38476&view=rev
Log:
modified include/reactos/libs/pseh/pseh2.h
Did you know gcc doesn't let PSEH deter it from inlining a function? Allocate the
frame with __builtin_alloca so that this doesn't cause issues
Modified:
trunk/reactos/include/reactos/libs/pseh/pseh2.h
Modified: trunk/reactos/include/reactos/libs/pseh/pseh2.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/pseh/…
==============================================================================
--- trunk/reactos/include/reactos/libs/pseh/pseh2.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/libs/pseh/pseh2.h [iso-8859-1] Tue Dec 30 14:02:03 2008
@@ -135,9 +135,6 @@
#define ___SEH_STRINGIFY(X_) # X_
#define __SEH_STRINGIFY(X_) ___SEH_STRINGIFY(X_)
-#define __SEH_FORCE_NEST \
- __asm__ __volatile__("#%0" : : "r" (&_SEHFrame))
-
#define __SEH_EXCEPT_RET long
#define __SEH_EXCEPT_ARGS __attribute__((unused)) _SEH2Frame_t * _SEH2FrameP,
__attribute__((unused)) struct _EXCEPTION_POINTERS * _SEHExceptionInformation
#define __SEH_EXCEPT_ARGS_ , __SEH_EXCEPT_ARGS
@@ -202,14 +199,16 @@
__label__ _SEHDoTry; \
__label__ _SEHAfterTry; \
static const int _SEH2ScopeKind = 0; \
- _SEH2Frame_t _SEHFrame; \
volatile _SEH2TryLevel_t _SEHTryLevel; \
- _SEH2Frame_t * const _SEH2FrameP = _SEHTopTryLevel ? &_SEHFrame : _SEHCurFrameP;
\
+ void * _SEHStackPointer; \
volatile _SEH2TryLevel_t * const _SEH2TryLevelP = &_SEHTryLevel; \
+ _SEH2Frame_t * const _SEH2FrameP = _SEHTopTryLevel ? \
+ ({ __asm__ __volatile__("mov %%esp, %0" : "=g"
(_SEHStackPointer)); __builtin_alloca(sizeof(_SEH2Frame_t)); }) : \
+ _SEHCurFrameP; \
\
(void)_SEH2ScopeKind; \
- (void)_SEHFrame; \
(void)_SEHTryLevel; \
+ (void)_SEHStackPointer; \
(void)_SEH2FrameP; \
(void)_SEH2TryLevelP; \
\
@@ -220,7 +219,7 @@
__SEH_ENTER_TRYLEVEL(); \
\
if(_SEHTopTryLevel) \
- _SEH2EnterFrame(&_SEHFrame); \
+ _SEH2EnterFrame(_SEH2FrameP); \
#define __SEH_END_SCOPE \
} \
@@ -346,7 +345,10 @@
\
_SEHAfterTry:; \
if(_SEHTopTryLevel) \
+ { \
_SEH2LeaveFrame(); \
+ __asm__ __volatile__("mov %0, %%esp" : : "g" (_SEHStackPointer));
\
+ } \
else \
{ \
__SEH_LEAVE_TRYLEVEL(); \