From 00b5c5cc0067eb5eb4936682cb7b60b24729843d Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sun, 15 Jul 2012 23:44:53 +0200 Subject: [PATCH] In the Windows handler for floating point exceptions, exceptions must be cleared up so as to prevent an infinite loop. --- src/c/unixint.d | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/c/unixint.d b/src/c/unixint.d index bfde8d0cb..47509a294 100644 --- a/src/c/unixint.d +++ b/src/c/unixint.d @@ -1058,25 +1058,32 @@ _ecl_w32_exception_filter(struct _EXCEPTION_POINTERS* ep) } /* Catch all arithmetic exceptions */ case EXCEPTION_INT_DIVIDE_BY_ZERO: + feclearexcept(FE_ALL_EXCEPT); handle_signal_now(@'division-by-zero', the_env->own_process); return EXCEPTION_CONTINUE_EXECUTION; case EXCEPTION_INT_OVERFLOW: + feclearexcept(FE_ALL_EXCEPT); handle_signal_now(@'arithmetic-error', the_env->own_process); return EXCEPTION_CONTINUE_EXECUTION; case EXCEPTION_FLT_DIVIDE_BY_ZERO: + feclearexcept(FE_ALL_EXCEPT); handle_signal_now(@'floating-point-overflow', the_env->own_process); return EXCEPTION_CONTINUE_EXECUTION; case EXCEPTION_FLT_OVERFLOW: + feclearexcept(FE_ALL_EXCEPT); handle_signal_now(@'floating-point-overflow', the_env->own_process); return EXCEPTION_CONTINUE_EXECUTION; case EXCEPTION_FLT_UNDERFLOW: + feclearexcept(FE_ALL_EXCEPT); handle_signal_now(@'floating-point-underflow', the_env->own_process); return EXCEPTION_CONTINUE_EXECUTION; case EXCEPTION_FLT_INEXACT_RESULT: + feclearexcept(FE_ALL_EXCEPT); handle_signal_now(@'floating-point-inexact', the_env->own_process); return EXCEPTION_CONTINUE_EXECUTION; case EXCEPTION_FLT_DENORMAL_OPERAND: case EXCEPTION_FLT_INVALID_OPERATION: + feclearexcept(FE_ALL_EXCEPT); handle_signal_now(@'floating-point-invalid-operation', the_env->own_process); return EXCEPTION_CONTINUE_EXECUTION; case EXCEPTION_FLT_STACK_CHECK: