(Not part of the mozilla build)

Added a guard against casting infinity->int, towards porting to alpha linux.
This commit is contained in:
mccabe 1998-06-17 19:36:29 +00:00
Родитель 8bd47553c7
Коммит 80299f312d
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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;