Commit 8923be8f authored by Bernhard Kölbl's avatar Bernhard Kölbl Committed by Alexandre Julliard

xml2: Use MSVC constants for NaN and infinity.

Prevent division by zero exceptions from being thrown, if they are enabled and calls to xmlXPathInit() are being made. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52003Signed-off-by: 's avatarBernhard Kölbl <besentv@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent c6b5f4a4
...@@ -497,14 +497,12 @@ double xmlXPathNINF; ...@@ -497,14 +497,12 @@ double xmlXPathNINF;
* *
* Initialize the XPath environment * Initialize the XPath environment
*/ */
ATTRIBUTE_NO_SANITIZE("float-divide-by-zero")
void void
xmlXPathInit(void) { xmlXPathInit(void) {
/* MSVC doesn't allow division by zero in constant expressions. */ /* Use MSVC definitions */
double zero = 0.0; xmlXPathNAN = NAN;
xmlXPathNAN = 0.0 / zero; xmlXPathPINF = INFINITY;
xmlXPathPINF = 1.0 / zero; xmlXPathNINF = -INFINITY;
xmlXPathNINF = -xmlXPathPINF;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment