jscript: Use quiet NaNs in jsval.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50845
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit d9a4392d6b)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Jacek Caban 2021-04-05 20:40:42 +02:00 committed by Michael Stefaniuc
parent 08397d2346
commit adc1b84adb
1 changed files with 5 additions and 5 deletions

View File

@ -35,8 +35,8 @@
#endif #endif
#ifdef JSVAL_DOUBLE_LAYOUT_PTR32 #ifdef JSVAL_DOUBLE_LAYOUT_PTR32
/* NaN exponent and our 0x80000 marker */ /* NaN exponent, quiet bit 0x80000 and our 0x10000 marker */
#define JSV_VAL(x) (0x7ff80000|x) #define JSV_VAL(x) (0x7ff90000|x)
#else #else
#define JSV_VAL(x) x #define JSV_VAL(x) x
#endif #endif
@ -150,10 +150,10 @@ static inline jsval_t jsval_number(double n)
if((ret.u.s.tag & 0x7ff00000) == 0x7ff00000) { if((ret.u.s.tag & 0x7ff00000) == 0x7ff00000) {
/* isinf */ /* isinf */
if(ret.u.s.tag & 0xfffff) { if(ret.u.s.tag & 0xfffff) {
ret.u.s.tag = 0x7ff00000; ret.u.s.tag = 0x7ff80000;
ret.u.s.u.as_uintptr = ~0; ret.u.s.u.as_uintptr = ~0;
}else if(ret.u.s.u.as_uintptr) { }else if(ret.u.s.u.as_uintptr) {
ret.u.s.tag = 0x7ff00000; ret.u.s.tag = 0x7ff80000;
} }
} }
#else #else
@ -191,7 +191,7 @@ static inline BOOL is_string(jsval_t v)
static inline BOOL is_number(jsval_t v) static inline BOOL is_number(jsval_t v)
{ {
#ifdef JSVAL_DOUBLE_LAYOUT_PTR32 #ifdef JSVAL_DOUBLE_LAYOUT_PTR32
return (v.u.s.tag & 0x7ff80000) != 0x7ff80000; return (v.u.s.tag & 0x7ff10000) != 0x7ff10000;
#else #else
return v.type == JSV_NUMBER; return v.type == JSV_NUMBER;
#endif #endif