Author: tkreuzer Date: Sat Apr 5 16:49:17 2014 New Revision: 62629
URL: http://svn.reactos.org/svn/reactos?rev=62629&view=rev Log: [PSEH_TEST] #if out a test for C++. This test only shows the limitations of PSEH and does not provide a satisfying result anyway.
Modified: trunk/rostests/tests/pseh2/psehtest.c
Modified: trunk/rostests/tests/pseh2/psehtest.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/tests/pseh2/psehtest.c?rev... ============================================================================== --- trunk/rostests/tests/pseh2/psehtest.c [iso-8859-1] (original) +++ trunk/rostests/tests/pseh2/psehtest.c [iso-8859-1] Sat Apr 5 16:49:17 2014 @@ -2447,6 +2447,15 @@ return (val == 3) || (val == 4) || (val == 5); }
+/* This test is mainly for documentation purpose. As can be seen it doesn't + provide a satisfying result. In fact the compiler could do even more + crazy things like reusing val1 between the assignment to 0 and the last + assignment to 3. This DOES happen with C++ and it's NOT a PSEH bug, but + rather an unavoidable consequence of how the compiler works. + The conclusion: Do not use assignments to a variable inside a __try block + that is being used later inside the __except block, unless it is declared + volatile! */ +#ifndef __cplusplus DEFINE_TEST(test_unvolatile_3) { int register val1 = 0, val2 = 0; @@ -2494,6 +2503,7 @@
return FALSE; } +#endif // __cplusplus
DEFINE_TEST(test_unvolatile_4) { @@ -2840,7 +2850,9 @@
USE_TEST(test_unvolatile), USE_TEST(test_unvolatile_2), +#ifndef __cplusplus USE_TEST(test_unvolatile_3), +#endif USE_TEST(test_unvolatile_4), USE_TEST(test_finally_goto), USE_TEST(test_nested_exception),