Skip to content

Commit

Permalink
Clear some more exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
yitzchak committed Aug 20, 2024
1 parent 770f60b commit cc57604
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/clasp/core/numbers.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
#error "Don't know how to provide FPE for this platform."
#endif

#define __FE_ALL_EXCEPT (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
#define __FE_ALL_EXCEPT FE_ALL_EXCEPT

inline int feenableexcept(int excepts) {
static fenv_t fenv;
Expand Down
2 changes: 2 additions & 0 deletions src/gctools/interrupt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,15 @@ int global_pollTicksGC = INITIAL_GLOBAL_POLL_TICKS_PER_CLEANUP;

DOCGROUP(clasp);
CL_DEFUN int core__fe_enable_except(int ex) {
feclearexcept(FE_ALL_EXCEPT);
int prev = feenableexcept(ex);
_lisp->setTrapFpeBits(fegetexcept());
return prev;
}

DOCGROUP(clasp);
CL_DEFUN int core__fe_disable_except(int ex) {
feclearexcept(FE_ALL_EXCEPT);
int prev = fedisableexcept(ex);
_lisp->setTrapFpeBits(fegetexcept());
return prev;
Expand Down

0 comments on commit cc57604

Please sign in to comment.