diff --git a/libs/xml2/xpath.c b/libs/xml2/xpath.c index 7497ba07d6f..5fa3c72eb6c 100644 --- a/libs/xml2/xpath.c +++ b/libs/xml2/xpath.c @@ -497,14 +497,12 @@ double xmlXPathNINF; * * Initialize the XPath environment */ -ATTRIBUTE_NO_SANITIZE("float-divide-by-zero") void xmlXPathInit(void) { - /* MSVC doesn't allow division by zero in constant expressions. */ - double zero = 0.0; - xmlXPathNAN = 0.0 / zero; - xmlXPathPINF = 1.0 / zero; - xmlXPathNINF = -xmlXPathPINF; + /* Use MSVC definitions */ + xmlXPathNAN = NAN; + xmlXPathPINF = INFINITY; + xmlXPathNINF = -INFINITY; } /**