From 4fd5237c0e22ce13bed0b7b6363670c79a8eb24f Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 8 Feb 2024 23:03:04 +0100 Subject: [PATCH] * mask FPU exceptions during libxml initialization to avoid an fpu exception with newer libxml, resolves #40622 --- packages/libxml/src/xml2.pas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/libxml/src/xml2.pas b/packages/libxml/src/xml2.pas index 6bc3813e7f..6411b423e0 100644 --- a/packages/libxml/src/xml2.pas +++ b/packages/libxml/src/xml2.pas @@ -20,10 +20,12 @@ interface uses System.DynLibs, System.CTypes; + System.Math; {$ELSE FPC_DOTTEDUNITS} uses dynlibs, - ctypes; + ctypes, + math; {$ENDIF FPC_DOTTEDUNITS} const @@ -358,6 +360,9 @@ begin end; {$ENDIF} +var + mask : TFPUExceptionMask; + initialization {$IFDEF NO_EXTERNAL_VARS} LoadExternalVariables; @@ -373,8 +378,12 @@ initialization * between the version it was compiled for and the actual shared * library used. *) + mask:=GetExceptionMask; + SetExceptionMask([exInvalidOp,exDenormalized,exZeroDivide,exOverflow,exUnderflow,exPrecision]); + LIBXML_TEST_VERSION; + SetExceptionMask(mask); (* * overloading the error functions *)