From 7e07b4f8e584974e0cf885576a63fcac4e778bb7 Mon Sep 17 00:00:00 2001 From: "brendan%mozilla.org" Date: Thu, 3 May 2007 06:39:44 +0000 Subject: [PATCH] Balance the stack for destructuring catch heads (379483, r=igor). git-svn-id: svn://10.0.0.236/trunk@225513 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/src/jsopcode.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mozilla/js/src/jsopcode.c b/mozilla/js/src/jsopcode.c index 4afdccb3824..130f63c3aba 100644 --- a/mozilla/js/src/jsopcode.c +++ b/mozilla/js/src/jsopcode.c @@ -2472,7 +2472,6 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb) LOCAL_ASSERT(*pc == JSOP_SETLOCALPOP); i = GET_UINT16(pc); pc += JSOP_SETLOCALPOP_LENGTH; - (void) PopOff(ss, JSOP_NOP); atom = atomv[i - OBJ_BLOCK_DEPTH(cx, obj)]; str = ATOM_TO_STRING(atom); if (!QuoteString(&jp->sprinter, str, 0)) { @@ -2483,6 +2482,13 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb) } #endif + /* + * Pop the exception_cookie (or its dup in the case of a + * guarded catch head) off the stack now. + */ + rval = PopStr(ss, JSOP_NOP); + LOCAL_ASSERT(strcmp(rval, exception_cookie) == 0); + len = js_GetSrcNoteOffset(sn, 0); if (len) { len -= PTRDIFF(pc, pc2, jsbytecode);