Bug 460116 - buggy inCond propagation in js_FoldConstants (r=jorendorff).

This commit is contained in:
Brendan Eich
2008-10-15 14:02:33 -07:00
parent 2206efba44
commit 6ac4abb95b
3 changed files with 43 additions and 32 deletions

View File

@@ -63,6 +63,7 @@
#include "jsemit.h"
#include "jsfun.h"
#include "jsiter.h"
#include "jsnum.h"
#include "jsobj.h"
#include "jsopcode.h"
#include "jsregexp.h"
@@ -72,10 +73,6 @@
#include "jsstr.h"
#include "jsstaticcheck.h"
#if JS_HAS_DESTRUCTURING
# include "jsnum.h"
#endif
#include "jsautooplen.h"
/* Verify JSOP_XXX_LENGTH constant definitions. */
@@ -1270,11 +1267,6 @@ GetLocal(SprintStack *ss, jsint i)
#undef LOCAL_ASSERT
}
#if JS_HAS_DESTRUCTURING
#define LOCAL_ASSERT(expr) LOCAL_ASSERT_RV(expr, NULL)
#define LOAD_OP_DATA(pc) (oplen = (cs = &js_CodeSpec[op=(JSOp)*pc])->length)
static JSBool
IsVarSlot(JSPrinter *jp, jsbytecode *pc, jsint *indexp)
{
@@ -1294,6 +1286,11 @@ IsVarSlot(JSPrinter *jp, jsbytecode *pc, jsint *indexp)
return JS_FALSE;
}
#if JS_HAS_DESTRUCTURING
#define LOCAL_ASSERT(expr) LOCAL_ASSERT_RV(expr, NULL)
#define LOAD_OP_DATA(pc) (oplen = (cs = &js_CodeSpec[op=(JSOp)*pc])->length)
static jsbytecode *
DecompileDestructuring(SprintStack *ss, jsbytecode *pc, jsbytecode *endpc);
@@ -2254,7 +2251,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb, JSOp nextop)
case JSOP_POPN:
{
uintN newtop, oldtop, i;
uintN newtop, oldtop;
/*
* The compiler models operand stack depth and fixes the stack
@@ -2276,7 +2273,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb, JSOp nextop)
VarPrefix(sn));
if (todo < 0)
return NULL;
for (i = newtop; i < oldtop; i++) {
for (uintN i = newtop; i < oldtop; i++) {
rval = OFF2STR(&ss->sprinter, ss->offsets[i]);
if (Sprint(&ss->sprinter, ss_format,
(i == newtop) ? "" : ", ",