Add special handling for gcc specific exceptions, which are continuable.


git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@3571 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-crt/crt/crt_handler.c b/mingw-w64-crt/crt/crt_handler.c
index 7f75eac..932fa26 100644
--- a/mingw-w64-crt/crt/crt_handler.c
+++ b/mingw-w64-crt/crt/crt_handler.c
@@ -185,6 +185,8 @@
 long CALLBACK
 _gnu_exception_handler (EXCEPTION_POINTERS *exception_data);
 
+#define GCC_MAGIC (('G' << 16) | ('C' << 8) | 'C' | (1U << 29))
+
 long CALLBACK
 _gnu_exception_handler (EXCEPTION_POINTERS *exception_data)
 {
@@ -192,6 +194,14 @@
   long action = EXCEPTION_CONTINUE_SEARCH;
   int reset_fpu = 0;
 
+#ifdef __SEH__
+  if ((exception_data->ExceptionRecord->ExceptionCode & 0x20ffffff) == GCC_MAGIC)
+    {
+      if ((exception_data->ExceptionRecord->ExceptionFlags & EXCEPTION_NONCONTINUABLE) == 0)
+        return EXCEPTION_CONTINUE_EXECUTION;
+    }
+#endif
+
   switch (exception_data->ExceptionRecord->ExceptionCode)
     {
     case EXCEPTION_ACCESS_VIOLATION: