(Not part of the mozilla build)

Added a guard against casting infinity->int, towards porting to alpha linux.


git-svn-id: svn://10.0.0.236/trunk@3991 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mccabe 1998-06-17 19:36:29 +00:00
parent 3677bf1dca
commit 021b3ef3b3

View File

@ -1194,7 +1194,7 @@ JS_DefineConstDoubles(JSContext *cx, JSObject *obj, JSConstDoubleSpec *cds)
/* We can't do a (jsint) cast to check against JSDOUBLE_IS_INT until we
* know that d is not NaN, or we risk a FPE on some platforms.
*/
if (JSDOUBLE_IS_NaN(d)) {
if (JSDOUBLE_IS_NaN(d) || !JSDOUBLE_IS_FINITE(d)) {
value = DOUBLE_TO_JSVAL(&cds->dval);
} else {
jsint i = (jsint)d;