From 472d45bc48ccaeceb621f66cad0289b12e0912f6 Mon Sep 17 00:00:00 2001 From: "brendan%mozilla.org" Date: Tue, 23 Mar 2004 02:09:38 +0000 Subject: [PATCH] Fix broken-since-rev-3.6.4.11 forelem normal-termination stack cleanup code-gen (174709, r=shaver, a=chofmann). --- js/src/jsemit.c | 19 ++----------------- js/src/jsinterp.c | 1 + 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/js/src/jsemit.c b/js/src/jsemit.c index 9f026cd9aee4..fae66f85210e 100644 --- a/js/src/jsemit.c +++ b/js/src/jsemit.c @@ -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; diff --git a/js/src/jsinterp.c b/js/src/jsinterp.c index 60f39b3cefd1..36de3e748f22 100644 --- a/js/src/jsinterp.c +++ b/js/src/jsinterp.c @@ -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]; }