Author: hyperion
Date: Wed Jul 8 23:52:48 2009
New Revision: 41812
URL:
http://svn.reactos.org/svn/reactos?rev=41812&view=rev
Log:
modified include/reactos/libs/pseh/pseh2.h
Only leave the frame in the outermost _SEH2_END (like in PSEH1)
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] Wed Jul 8 23:52:48 2009
@@ -194,16 +194,18 @@
#define __SEH_ENTER_SCOPE(TRYLEVEL_) (_SEHTopTryLevel ?
__SEH_ENTER_FRAME_AND_TRYLEVEL(TRYLEVEL_) : __SEH_ENTER_TRYLEVEL(TRYLEVEL_))
#define __SEH_ENTER_HANDLE_SCOPE(TRYLEVEL_, HANDLE_) (({ __SEH_BARRIER; __asm__
__volatile__("mov %%esp, %0" : "=m" ((TRYLEVEL_)->SHT_Esp));
__SEH_BARRIER; }), (_SEHTopTryLevel ? __SEH_ENTER_FRAME_AND_HANDLE_TRYLEVEL((TRYLEVEL_),
(HANDLE_)) : __SEH_ENTER_HANDLE_TRYLEVEL((TRYLEVEL_), (HANDLE_))))
-#define __SEH_LEAVE_SCOPE() \
+#define __SEH_LEAVE_TRYLEVEL() \
+ if(!_SEHTopTryLevel) \
+ { \
+ __SEH_SET_TRYLEVEL(_SEHPrevTryLevelP); \
+ } \
+
+#define __SEH_LEAVE_FRAME() \
if(_SEHTopTryLevel) \
{ \
_SEH2LeaveFrame(); \
__asm__ __volatile__("mov %0, %%esp" : : "g" (_SEHStackPointer));
\
- } \
- else \
- { \
- __SEH_SET_TRYLEVEL(_SEHPrevTryLevelP); \
- } \
+ }
#define __SEH_END_SCOPE_CHAIN \
static __attribute__((unused)) const int _SEH2ScopeKind = 1; \
@@ -289,7 +291,7 @@
\
_SEHAbnormalTermination = 0; \
\
- __SEH_LEAVE_SCOPE(); \
+ __SEH_LEAVE_TRYLEVEL(); \
\
_SEHFinally(); \
goto _SEHEndExcept; \
@@ -362,7 +364,7 @@
__attribute__((unused)) __SEH_DEFINE_FINALLY(_SEHFinally) { __SEH_RETURN_FINALLY(); }
\
\
_SEHAfterTry:; \
- __SEH_LEAVE_SCOPE(); \
+ __SEH_LEAVE_TRYLEVEL(); \
\
goto _SEHEndExcept; \
\
@@ -377,6 +379,8 @@
} \
\
_SEHEndExcept:; \
+ \
+ __SEH_LEAVE_FRAME(); \
} \
__SEH_END_SCOPE;