mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 579647 - use canonical nan in js_dmod (r=dvander)
This commit is contained in:
parent
8c1b9cb83f
commit
015cd3448d
@ -85,8 +85,8 @@ js_dmod(jsdouble a, jsdouble b)
|
||||
{
|
||||
if (b == 0.0) {
|
||||
jsdpun u;
|
||||
u.s.hi = JSDOUBLE_HI32_EXPMASK | JSDOUBLE_HI32_MANTMASK;
|
||||
u.s.lo = 0xffffffff;
|
||||
u.s.hi = JSDOUBLE_HI32_NAN;
|
||||
u.s.lo = JSDOUBLE_LO32_NAN;
|
||||
return u.d;
|
||||
}
|
||||
return js_fmod(a, b);
|
||||
|
@ -677,8 +677,8 @@ js_InitRuntimeNumberState(JSContext *cx)
|
||||
FIX_FPU();
|
||||
|
||||
jsdpun u;
|
||||
u.s.hi = 0x7ff80000;
|
||||
u.s.lo = 0x00000000;
|
||||
u.s.hi = JSDOUBLE_HI32_NAN;
|
||||
u.s.lo = JSDOUBLE_LO32_NAN;
|
||||
number_constants[NC_NaN].dval = js_NaN = u.d;
|
||||
rt->NaNValue.setDouble(u.d);
|
||||
|
||||
|
@ -121,6 +121,8 @@ JSDOUBLE_IS_INFINITE(jsdouble d)
|
||||
#define JSDOUBLE_HI32_SIGNBIT 0x80000000
|
||||
#define JSDOUBLE_HI32_EXPMASK 0x7ff00000
|
||||
#define JSDOUBLE_HI32_MANTMASK 0x000fffff
|
||||
#define JSDOUBLE_HI32_NAN 0x7ff80000
|
||||
#define JSDOUBLE_LO32_NAN 0x00000000
|
||||
|
||||
static inline bool
|
||||
JSDOUBLE_IS_NEG(jsdouble d)
|
||||
|
@ -518,13 +518,13 @@ JS_XDRDouble(JSXDRState *xdr, jsdouble *dp)
|
||||
}
|
||||
|
||||
enum XDRValueTag {
|
||||
XDRTAG_OBJECT = 0x0,
|
||||
XDRTAG_INT = 0x1,
|
||||
XDRTAG_DOUBLE = 0x2,
|
||||
XDRTAG_STRING = 0x4,
|
||||
XDRTAG_SPECIAL = 0x6,
|
||||
XDRTAG_XDRNULL = 0x8,
|
||||
XDRTAG_XDRVOID = 0xA
|
||||
XDRTAG_OBJECT = 0,
|
||||
XDRTAG_INT = 1,
|
||||
XDRTAG_DOUBLE = 2,
|
||||
XDRTAG_STRING = 3,
|
||||
XDRTAG_SPECIAL = 4,
|
||||
XDRTAG_XDRNULL = 5,
|
||||
XDRTAG_XDRVOID = 6
|
||||
};
|
||||
|
||||
static XDRValueTag
|
||||
|
@ -205,7 +205,7 @@ JS_XDRFindClassById(JSXDRState *xdr, uint32 id);
|
||||
* before deserialization of bytecode. If the saved version does not match
|
||||
* the current version, abort deserialization and invalidate the file.
|
||||
*/
|
||||
#define JSXDR_BYTECODE_VERSION (0xb973c0de - 65)
|
||||
#define JSXDR_BYTECODE_VERSION (0xb973c0de - 66)
|
||||
|
||||
/*
|
||||
* Library-private functions.
|
||||
|
13
js/src/trace-test/tests/basic/testBug579647.js
Normal file
13
js/src/trace-test/tests/basic/testBug579647.js
Normal file
@ -0,0 +1,13 @@
|
||||
expected = "TypeError: NaN is not a function";
|
||||
actual = "";
|
||||
|
||||
try {
|
||||
a = ""
|
||||
for each(x in [0, 0, 0, 0]) {
|
||||
a %= x
|
||||
} ( - a)()
|
||||
} catch (e) {
|
||||
actual = '' + e;
|
||||
}
|
||||
|
||||
assertEq(expected, actual);
|
Loading…
Reference in New Issue
Block a user