void use_lots_of_stack(void) { int i; volatile int arr[512]; for (i = 0; i < 512; i++) arr[i] = 123; (void)arr; } static int test_PSEH3_bug2(void) { long status = 0; _SEH3$_PreventInlining(); do { __label__ _SEH3$_l_BeforeTry; __label__ _SEH3$_l_DoTry; __label__ _SEH3$_l_AfterTry; __label__ _SEH3$_l_EndTry; __label__ _SEH3$_l_HandlerTarget; __label__ _SEH3$_l_OnException; __label__ _SEH3$_l_BeforeFilterOrFinally; __label__ _SEH3$_l_FilterOrFinally; (void)&&_SEH3$_l_OnException; (void)&&_SEH3$_l_BeforeFilterOrFinally; (void)&&_SEH3$_l_FilterOrFinally; enum { _SEH3$_PreviousTryLevel = _SEH3$_TryLevel, _SEH3$_TryLevel = _SEH3$_PreviousTryLevel + 1, }; auto inline __attribute__((always_inline,gnu_inline)) void _SEH3$_AutoCleanup(volatile SEH3$_REGISTRATION_FRAME *p); volatile SEH3$_REGISTRATION_FRAME __attribute__((cleanup(_SEH3$_AutoCleanup))) _SEH3$_TrylevelFrame; goto _SEH3$_l_BeforeTry; goto _SEH3$_l_AfterTry; _SEH3$_l_DoTry: do { *(volatile int*)0x12345678 = 0x12345678; } while (0); _SEH3$_l_AfterTry: (void)0; goto _SEH3$_l_EndTry; _SEH3$_l_BeforeTry: (void)0; asm goto ("#\n" : : : "memory" : _SEH3$_l_OnException); auto int __attribute__((__fastcall__)) _SEH3$_FilterFunction(int Action); static const SEH3$_SCOPE_TABLE _SEH3$_ScopeTable = { &&_SEH3$_l_HandlerTarget, (__builtin_constant_p((1)) ? (void*)(unsigned long)(unsigned char)(unsigned long)((1)) : &_SEH3$_FilterFunction), _SEH3$_TryLevel, _SEH3$_HANDLER_TYPE }; if (_SEH3$_TryLevel == 1) asm goto ( "leal %0, %%eax\n\t" "leal %1, %%edx\n\t" "call " "__SEH3$_RegisterFrame" : : "m" (*(&_SEH3$_TrylevelFrame)), "m" (*(&_SEH3$_ScopeTable)), "p" (_SEH3$_RegisterFrameWithNonVolatiles) : "eax", "edx", "ecx", "memory" : _SEH3$_l_BeforeTry, _SEH3$_l_HandlerTarget, _SEH3$_l_OnException, _SEH3$_l_BeforeFilterOrFinally, _SEH3$_l_FilterOrFinally ); else asm goto ( "leal %0, %%eax\n\t" "leal %1, %%edx\n\t" "call " "__SEH3$_RegisterTryLevel" : : "m" (*(&_SEH3$_TrylevelFrame)), "m" (*(&_SEH3$_ScopeTable)), "p" (_SEH3$_RegisterFrameWithNonVolatiles) : "eax", "edx", "ecx", "memory" : _SEH3$_l_BeforeTry, _SEH3$_l_HandlerTarget, _SEH3$_l_OnException, _SEH3$_l_BeforeFilterOrFinally, _SEH3$_l_FilterOrFinally ); auto inline __attribute__((always_inline,gnu_inline)) int _SEH3$_FinallyFunction(int Action) { (void)Action; return 0; } inline __attribute__((always_inline, gnu_inline)) unsigned long _exception_code() { return _SEH3$_TrylevelFrame.ExceptionPointers->ExceptionRecord->ExceptionCode; }; goto _SEH3$_l_DoTry; _SEH3$_l_BeforeFilterOrFinally: (void)0; asm volatile ( "#\n" : : "m"(*(char*)__builtin_alloca(0)) : "%esp", "memory" ); _SEH3$_l_FilterOrFinally: (void)0; int __attribute__((__fastcall__)) _SEH3$_FilterFunction(int Action) { if (Action == 0) return (int)&_SEH3$_TrylevelFrame; inline __attribute__((always_inline, gnu_inline)) unsigned long _exception_code() { return _SEH3$_TrylevelFrame.ExceptionPointers->ExceptionRecord->ExceptionCode; } inline __attribute__((always_inline, gnu_inline)) void * _exception_info() { return _SEH3$_TrylevelFrame.ExceptionPointers; } return ((1)); } _SEH3$_l_HandlerTarget: (void)0; asm volatile ( "#\n" : : "m"(*(char*)__builtin_alloca(0)) : "%esp", "memory" ); if (1) { asm volatile ("#\n"); do { use_lots_of_stack(); status = _exception_code(); } while (0); }; goto _SEH3$_l_EndTry; _SEH3$_l_OnException: (void)0; void *plabel; asm goto ( "#\n" : : : "memory" : _SEH3$_l_BeforeTry, _SEH3$_l_HandlerTarget, _SEH3$_l_OnException, _SEH3$_l_BeforeFilterOrFinally, _SEH3$_l_FilterOrFinally ); asm volatile ( "#" : "=a"(plabel) : "p"(&&_SEH3$_l_BeforeTry), "p"(&&_SEH3$_l_HandlerTarget), "p"(&&_SEH3$_l_OnException), "p"(&&_SEH3$_l_FilterOrFinally) : "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" ); goto _SEH3$_l_OnException;; _SEH3$_l_EndTry: (void)0; asm goto ( "#\n" : : : "memory" : _SEH3$_l_OnException ); auto inline __attribute__((always_inline,gnu_inline)) void _SEH3$_AutoCleanup(volatile SEH3$_REGISTRATION_FRAME *p) { (void)p; if (_SEH3$_TryLevel == 1) _SEH3$_UnregisterFrame(&_SEH3$_TrylevelFrame); else _SEH3$_UnregisterTryLevel(&_SEH3$_TrylevelFrame); _SEH3$_FinallyFunction(1); }; } while (0);; return (status == ((DWORD)0xC0000005)); }