From: Jacek Caban Subject: [PATCH] jscript: Use quiet NaNs in jsval. Message-Id: <1c784912-6e12-c52e-ea2c-fdfe68d8d039@codeweavers.com> Date: Mon, 5 Apr 2021 20:40:42 +0200 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50845 Signed-off-by: Jacek Caban --- dlls/jscript/jsval.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/jscript/jsval.h b/dlls/jscript/jsval.h index 963f59f6a08..9f451b12831 100644 --- a/dlls/jscript/jsval.h +++ b/dlls/jscript/jsval.h @@ -35,8 +35,8 @@ #endif #ifdef JSVAL_DOUBLE_LAYOUT_PTR32 -/* NaN exponent and our 0x80000 marker */ -#define JSV_VAL(x) (0x7ff80000|x) +/* NaN exponent, quiet bit 0x80000 and our 0x10000 marker */ +#define JSV_VAL(x) (0x7ff90000|x) #else #define JSV_VAL(x) x #endif @@ -150,10 +150,10 @@ static inline jsval_t jsval_number(double n) if((ret.u.s.tag & 0x7ff00000) == 0x7ff00000) { /* isinf */ if(ret.u.s.tag & 0xfffff) { - ret.u.s.tag = 0x7ff00000; + ret.u.s.tag = 0x7ff80000; ret.u.s.u.as_uintptr = ~0; }else if(ret.u.s.u.as_uintptr) { - ret.u.s.tag = 0x7ff00000; + ret.u.s.tag = 0x7ff80000; } } #else @@ -191,7 +191,7 @@ static inline BOOL is_string(jsval_t v) static inline BOOL is_number(jsval_t v) { #ifdef JSVAL_DOUBLE_LAYOUT_PTR32 - return (v.u.s.tag & 0x7ff80000) != 0x7ff80000; + return (v.u.s.tag & 0x7ff10000) != 0x7ff10000; #else return v.type == JSV_NUMBER; #endif