Cygwin: exceptions: fix FPE exception flags

The FPE flags for divisions by zero were not implemented

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2018-06-26 10:09:29 +02:00
parent 3dc89bbafe
commit dbe905c140
2 changed files with 10 additions and 1 deletions

View File

@ -649,9 +649,15 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
/* Coerce win32 value to posix value. */
switch (e->ExceptionCode)
{
case STATUS_FLOAT_DENORMAL_OPERAND:
case STATUS_FLOAT_DIVIDE_BY_ZERO:
si.si_signo = SIGFPE;
si.si_code = FPE_FLTDIV;
break;
case STATUS_FLOAT_DENORMAL_OPERAND:
case STATUS_FLOAT_INVALID_OPERATION:
si.si_signo = SIGFPE;
si.si_code = FPE_FLTINV;
break;
case STATUS_FLOAT_STACK_CHECK:
si.si_signo = SIGFPE;
si.si_code = FPE_FLTSUB;

View File

@ -33,3 +33,6 @@ Bug Fixes
- Fix a g++ compilation problem with -std=c++14 or -std=c++17.
Addresses: https://cygwin.com/ml/cygwin/2018-05/msg00316.html
- Fix FPE flag handling for division by zero conditions
Addresses: https://cygwin.com/ml/cygwin/2018-06/msg00281.html