Skip to content

Commit

Permalink
BUG: Disable all floating point exceptions
Browse files Browse the repository at this point in the history
itk::FloatingPointExceptions::Disable()

In this commit, a flag is added to disable all floating point exceptions, rather than just two exceptions. This bug was identified in the following discussion thread: https://discourse.itk.org/t/itk-not-loading-nrrd-files-any-more/4224/10. This fix will resolve an exception that occurs when loading NRRD images.
  • Loading branch information
courtneyambrozic authored and hjmjohnson committed Sep 15, 2021
1 parent 46b7187 commit cd3f05e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Modules/Core/Common/src/itkFloatingPointExceptions_unix.cxx
Expand Up @@ -176,8 +176,7 @@ FloatingPointExceptions::Disable()
{
itkInitGlobalsMacro(PimplGlobals);
#if defined(ITK_HAS_FPE_CAPABILITY)
itk_fedisableexcept(FE_DIVBYZERO);
itk_fedisableexcept(FE_INVALID);
itk_fedisableexcept(FE_ALL_EXCEPT);
FloatingPointExceptions::m_PimplGlobals->m_Enabled = false;
#else
itkFloatingPointExceptionsNotSupported();
Expand Down

0 comments on commit cd3f05e

Please sign in to comment.