From 021b3ef3b347dabdae810ab94ca9cfcee4e98ebb Mon Sep 17 00:00:00 2001 From: mccabe Date: Wed, 17 Jun 1998 19:36:29 +0000 Subject: [PATCH] (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 --- mozilla/js/ref/jsapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mozilla/js/ref/jsapi.c b/mozilla/js/ref/jsapi.c index 0e2fb9d9f5b..c43c5cdfbde 100644 --- a/mozilla/js/ref/jsapi.c +++ b/mozilla/js/ref/jsapi.c @@ -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;