Author: hyperion
Date: Sun Dec 21 13:51:09 2008
New Revision: 38246
URL:
http://svn.reactos.org/svn/reactos?rev=38246&view=rev
Log:
modified include/reactos/libs/pseh/pseh2.h
The return_twice and always_inline attributes don't mix: dump _SEH2PretendSetjmp,
mark _SEH2EnterFrame as returns_twice (i.e. setjmp-like) instead, piggybacking the
pretend-setjmp annotation on a function that's always called anyway. This ACTUALLY
ensures GCC won't put variables in registers that might be clobbered by a SEH catch -
at nearly no cost in binary code size and complexity
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] Sun Dec 21 13:51:09 2008
@@ -66,7 +66,7 @@
{
#endif
-extern void __cdecl _SEH2EnterFrame(_SEH2Frame_t *);
+extern __attribute__((returns_twice)) void __cdecl _SEH2EnterFrame(_SEH2Frame_t *);
extern void __cdecl _SEH2LeaveFrame(void);
extern void __cdecl _SEH2Return(void);
@@ -131,22 +131,11 @@
/* GCC doesn't know that this equals zero */
#define __SEH_VOLATILE_ZERO ({ int zero = 0; __asm__ __volatile__("#" :
"+g" (zero)); zero; })
-/* GCC believes this is setjmp */
-#define __SEH_PRETEND_SETJMP() (_SEH2PretendSetjmp(), 0)
-
#define __SEH_VOLATILE_FALSE __builtin_expect(__SEH_VOLATILE_ZERO, 0)
#define __SEH_VOLATILE_TRUE __builtin_expect(!__SEH_VOLATILE_ZERO, 1)
#define ___SEH_STRINGIFY(X_) # X_
#define __SEH_STRINGIFY(X_) ___SEH_STRINGIFY(X_)
-
-static
-__inline__
-__attribute__((returns_twice))
-__attribute__((always_inline))
-void _SEH2PretendSetjmp(void)
-{
-}
#define __SEH_FORCE_NEST \
__asm__ __volatile__("#%0" : : "r" (&_SEHFrame))
@@ -163,7 +152,6 @@
#define __SEH_RETURN_FINALLY() return
#define __SEH_BEGIN_TRY \
- if(!__SEH_PRETEND_SETJMP()) \
{ \
__label__ _SEHEndTry; \
\