Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2005-05-20 02:44:13 +0400
committerDanny Smith <dannysmith@users.sourceforge.net>2005-05-20 02:44:13 +0400
commit45e3403e7bdabd845864b13f4563ed9c731a58a3 (patch)
tree1cf2d7098d54b20eace5a71502f26f22e59a4ef9
parent89e5f7f81e84110d93e704afc35d51728486c9f7 (diff)
* crt1.c (_gnu_exception_handler): Handle illegal instruction
OS exception as a signal if user has defined a SIGILL handler.
-rw-r--r--winsup/mingw/ChangeLog5
-rw-r--r--winsup/mingw/crt1.c19
2 files changed, 24 insertions, 0 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index 32a8f25aa..5c74d22c6 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,3 +1,8 @@
+2005-05-20 Danny Smith <dannysmith@users.sourceforge
+
+ * crt1.c (_gnu_exception_handler): Handle illegal instruction
+ OS exception as a signal if user has defined a SIGILL handler.
+
2005-05-10 Danny Smith <dannysmith@users.sourceforge.net>
* mingwex/math/nexttoward.c: New file.
diff --git a/winsup/mingw/crt1.c b/winsup/mingw/crt1.c
index 780b75e5a..b9b2bd5b1 100644
--- a/winsup/mingw/crt1.c
+++ b/winsup/mingw/crt1.c
@@ -124,6 +124,25 @@ _gnu_exception_handler (EXCEPTION_POINTERS * exception_data)
}
break;
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ case EXCEPTION_PRIV_INSTRUCTION:
+ /* test if the user has set SIGILL */
+ old_handler = signal (SIGILL, SIG_DFL);
+ if (old_handler == SIG_IGN)
+ {
+ /* this is undefined if the signal was raised by anything other
+ than raise (). */
+ signal (SIGILL, SIG_IGN);
+ action = EXCEPTION_CONTINUE_EXECUTION;
+ }
+ else if (old_handler != SIG_DFL)
+ {
+ /* This means 'old' is a user defined function. Call it */
+ (*old_handler) (SIGILL);
+ action = EXCEPTION_CONTINUE_EXECUTION;
+ }
+ break;
+
case EXCEPTION_FLT_INVALID_OPERATION:
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
case EXCEPTION_FLT_DENORMAL_OPERAND: