From 913e1ed8b9be2707877dc6777b29fb0964399532 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 5 Apr 2014 16:56:00 +0000 Subject: [PATCH] [PSEH3] Make sure _abnormal_termination() returns the correct result and make sure the compiler does not rely on register values in the finally and filter function. The C++ PSEH tests now all pass. => We now have PSEH support for C++. svn path=/trunk/; revision=62630 --- reactos/include/reactos/libs/pseh/pseh3.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index 8b7ca201242..4fe95d45238 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -230,17 +230,19 @@ _SEH3$_AutoCleanup( #define _SEH3$_NESTED_FUNC_RETURN(_Result) \ /* Restore esp and return to the caller */ \ asm volatile ("movl %[FixedEsp], %%esp\nret\n" \ - : : "a"(_Result), [FixedEsp]"m"(_SEH3$_TrylevelFrame.AllocaFrame) : "memory") + : : "a"(_Result), [FixedEsp]"m"(_SEH3$_TrylevelFrame.AllocaFrame) : "ebx", "ecx", "edx", "esi", "edi", "flags", "memory") /* The filter "function" */ #define _SEH3$_DEFINE_FILTER_FUNC(_Name, expression) \ { \ /* Evaluate and return the filter expression */ \ + asm volatile ("#\n" : : : "eax", "ebx", "ecx", "edx", "esi", "edi", "flags", "memory"); \ _SEH3$_NESTED_FUNC_RETURN((expression)); \ } #define _SEH3$_FINALLY_FUNC_OPEN(_Name) \ { \ + asm volatile ("#\n" : : : "eax", "ebx", "ecx", "edx", "esi", "edi", "flags", "memory"); \ /* This construct makes sure that the finally function returns */ \ /* a proper value at the end */ \ for (; ; (void)({_SEH3$_NESTED_FUNC_RETURN(0); 0;})) @@ -429,6 +431,7 @@ _SEH3$_AutoCleanup( /* Register the registration record. */ \ if (_SEH3$_TryLevel == 1) _SEH3$_RegisterFrame_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ else _SEH3$_RegisterTryLevel_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ + _SEH3$_TrylevelFrame.ExceptionPointers = (PSEH3$_EXCEPTION_POINTERS)1; \ \ goto _SEH3$_l_DoTry; \ \