зеркало из https://github.com/mozilla/gecko-dev.git
Fix 312954 "monkey: on HPUX, special case failure when dividing by -0"
This commit is contained in:
Родитель
0b411ad632
Коммит
c7e0b4fd28
|
@ -1118,7 +1118,7 @@ js_Interpret(JSContext *cx, jsval *result)
|
|||
|
||||
#if JS_HAS_SWITCH_STATEMENT
|
||||
case JSOP_DEFAULT:
|
||||
POP();
|
||||
(void) POP();
|
||||
/* fall through */
|
||||
#endif
|
||||
case JSOP_GOTO:
|
||||
|
@ -1661,7 +1661,7 @@ js_Interpret(JSContext *cx, jsval *result)
|
|||
#if JS_HAS_SWITCH_STATEMENT
|
||||
case JSOP_CASE:
|
||||
NEW_EQUALITY_OP(==, JS_FALSE);
|
||||
POP();
|
||||
(void) POP();
|
||||
if (cond) {
|
||||
len = GET_JUMP_OFFSET(pc);
|
||||
CHECK_BRANCH(len);
|
||||
|
@ -1848,7 +1848,16 @@ js_Interpret(JSContext *cx, jsval *result)
|
|||
|
||||
case JSOP_NEG:
|
||||
POP_NUMBER(cx, d);
|
||||
#ifdef HPUX
|
||||
/*
|
||||
* Negation of a zero doesn't produce a negative
|
||||
* zero on HPUX. Perform the operation by bit
|
||||
* twiddling.
|
||||
*/
|
||||
JSDOUBLE_HI32(d) ^= JSDOUBLE_HI32_SIGNBIT;
|
||||
#else
|
||||
d = -d;
|
||||
#endif
|
||||
PUSH_NUMBER(cx, d);
|
||||
break;
|
||||
|
||||
|
|
|
@ -653,6 +653,16 @@ js_strtod(JSContext *cx, const jschar *s, const jschar **ep, jsdouble *dp)
|
|||
d = *cx->runtime->jsPositiveInfinity;
|
||||
else if (d == -HUGE_VAL)
|
||||
d = *cx->runtime->jsNegativeInfinity;
|
||||
#ifdef HPUX
|
||||
if (d == 0.0 && negative) {
|
||||
/*
|
||||
* "-0", "-1e-2000" come out as positive zero
|
||||
* here on HPUX. Force a negative zero instead.
|
||||
*/
|
||||
JSDOUBLE_HI32(d) = JSDOUBLE_HI32_SIGNBIT;
|
||||
JSDOUBLE_LO32(d) = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
free(cstr);
|
||||
|
|
|
@ -2704,7 +2704,16 @@ js_FoldConstants(JSContext *cx, JSParseNode *pn)
|
|||
break;
|
||||
|
||||
case JSOP_NEG:
|
||||
d = -d;
|
||||
#ifdef HPUX
|
||||
/*
|
||||
* Negation of a zero doesn't produce a negative
|
||||
* zero on HPUX. Perform the operation by bit
|
||||
* twiddling.
|
||||
*/
|
||||
JSDOUBLE_HI32(d) ^= JSDOUBLE_HI32_SIGNBIT;
|
||||
#else
|
||||
d = -d;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case JSOP_POS:
|
||||
|
|
Загрузка…
Ссылка в новой задаче