From a3eebf1ba34b940a5a004f4a63b57bc9dc80150d Mon Sep 17 00:00:00 2001 From: Marius Gerbershagen Date: Wed, 26 Feb 2020 19:39:11 +0100 Subject: [PATCH] Revert "ieee-fp: remove _fpreset from si_trap_fpe" This reverts commit bd9c590810a33d2843467fcefbb4f7d82784b8b6. Apparently, _fpreset is not just equivalent to feclearexcept and really needed when doing a longjmp out of a signal handler. On top of that, with MSVC 2019, I now observe segmentation faults without _fpreset, but not with _fpreset in si_trap_fpe! --- src/c/unixint.d | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/c/unixint.d b/src/c/unixint.d index db45a92d6..5b1af53e4 100644 --- a/src/c/unixint.d +++ b/src/c/unixint.d @@ -1236,6 +1236,9 @@ si_trap_fpe(cl_object condition, cl_object flag) # ifdef HAVE_FENV_H feclearexcept(all); # endif +# if defined(ECL_MS_WINDOWS_HOST) + _fpreset(); +# endif # ifdef HAVE_FEENABLEEXCEPT fedisableexcept(all & ~bits); feenableexcept(all & bits);