Bug 701239 - add back arg/local-handling in DecompileDestructuringLHS (r=waldo)

--HG--
extra : rebase_source : b296a3a47e4b687f773f9f5cf8bada7812ba2b81
This commit is contained in:
Luke Wagner 2011-11-10 21:55:23 -08:00
Родитель 7c50bc8925
Коммит 93ad21c3ca
2 изменённых файлов: 16 добавлений и 2 удалений

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

@ -0,0 +1 @@
(function f(w) { for([w] in 1) {} }).toString();

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

@ -1679,9 +1679,13 @@ DecompileDestructuringLHS(SprintStack *ss, jsbytecode *pc, jsbytecode *endpc,
case JSOP_SETLOCAL:
LOCAL_ASSERT(pc[oplen] == JSOP_POP || pc[oplen] == JSOP_POPN);
/* FALL THROUGH */
case JSOP_SETLOCALPOP:
if (IsVarSlot(jp, pc, &i)) {
if (op == JSOP_SETARG) {
atom = GetArgOrVarAtom(jp, GET_SLOTNO(pc));
LOCAL_ASSERT(atom);
if (!QuoteString(&ss->sprinter, atom, 0))
return NULL;
} else if (IsVarSlot(jp, pc, &i)) {
atom = GetArgOrVarAtom(jp, i);
LOCAL_ASSERT(atom);
if (!QuoteString(&ss->sprinter, atom, 0))
@ -1691,6 +1695,15 @@ DecompileDestructuringLHS(SprintStack *ss, jsbytecode *pc, jsbytecode *endpc,
if (!lval || SprintCString(&ss->sprinter, lval) < 0)
return NULL;
}
if (op != JSOP_SETLOCALPOP) {
pc += oplen;
if (pc == endpc)
return pc;
LOAD_OP_DATA(pc);
if (op == JSOP_POPN)
return pc;
LOCAL_ASSERT(op == JSOP_POP);
}
break;
default: {