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=52003 Signed-off-by: Bernhard Kölbl <besentv@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c6b5f4a406
commit
8923be8f68
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue