[PSEH]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 1 May 2014 10:27:38 +0000 (10:27 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 1 May 2014 10:27:38 +0000 (10:27 +0000)
When we use the dummy PSEH, use an if (ExternalVariable) around the except block. This is to make Coverity check the except handler as well and take into account that it could be executed.

svn path=/trunk/; revision=63092

reactos/include/reactos/libs/pseh/pseh2.h
reactos/lib/pseh/dummy.c

index b266658..ff11f61 100644 (file)
 
 #elif defined(_USE_DUMMY_PSEH) || defined (__arm__) || defined(__clang__) || defined(_M_AMD64)
 
+extern int _SEH2_Volatile0;
+extern int _SEH2_VolatileExceptionCode;
+
 #define _SEH2_TRY  {
 #define _SEH2_FINALLY }  {
-#define _SEH2_EXCEPT(...) } if (0) {
+#define _SEH2_EXCEPT(...) } if (_SEH2_Volatile0) {
 #define _SEH2_END }
 #define _SEH2_GetExceptionInformation()
-#define _SEH2_GetExceptionCode() 0
+#define _SEH2_GetExceptionCode() _SEH2_VolatileExceptionCode
 #define _SEH2_AbnormalTermination()
 #define _SEH2_YIELD(STMT_) STMT_
 #define _SEH2_LEAVE
index c21b66d..e35e958 100644 (file)
@@ -1,2 +1,4 @@
  /* intentionally empty file */
 
+int _SEH2_Volatile0 = 0;
+int _SEH2_VolatileExceptionCode = 0xC0000005;