mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Fix broken-since-rev-3.6.4.11 forelem normal-termination stack cleanup code-gen (174709, r=shaver, a=chofmann).
This commit is contained in:
parent
8ebba422fc
commit
472d45bc48
@ -2988,23 +2988,8 @@ js_EmitTree(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
|
||||
return JS_FALSE;
|
||||
|
||||
if (pn2->pn_type == TOK_IN) {
|
||||
/*
|
||||
* Generate the object and iterator pop opcodes after popping the
|
||||
* stmtInfo stack, so breaks will go to this pop bytecode.
|
||||
*/
|
||||
if (pn3->pn_type != TOK_LB) {
|
||||
if (js_Emit1(cx, cg, JSOP_POP2) < 0)
|
||||
return JS_FALSE;
|
||||
} else {
|
||||
/*
|
||||
* With 'for(x[i]...)', there's only the object on the stack,
|
||||
* so we need to hide the pop.
|
||||
*/
|
||||
if (js_NewSrcNote(cx, cg, SRC_HIDDEN) < 0)
|
||||
return JS_FALSE;
|
||||
if (js_Emit1(cx, cg, JSOP_POP) < 0)
|
||||
return JS_FALSE;
|
||||
}
|
||||
if (js_Emit1(cx, cg, JSOP_POP2) < 0)
|
||||
return JS_FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1924,6 +1924,7 @@ js_Interpret(JSContext *cx, jsval *result)
|
||||
} else {
|
||||
/* This is not the first iteration. Recover iterator state. */
|
||||
propobj = JSVAL_TO_OBJECT(rval);
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, propobj) == &prop_iterator_class);
|
||||
obj = JSVAL_TO_OBJECT(propobj->slots[JSSLOT_PARENT]);
|
||||
iter_state = propobj->slots[JSSLOT_ITER_STATE];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user