Attachment #259878: Fix v2c for bug #374589

View | Details | Raw Unified | Return to bug 374589
Collapse All | Expand All

(-)jsemit.c (-2 / +6 lines)
Line     Link Here 
 Lines 4872-4889   js_EmitTree(JSContext *cx, JSCodeGenerat Link Here 
4872
                     * have after the jumping from the previous guard.
4872
                     * have after the jumping from the previous guard.
4873
                     */
4873
                     */
4874
                    JS_ASSERT(cg->stackDepth == depth);
4874
                    JS_ASSERT(cg->stackDepth == depth);
4875
                    cg->stackDepth = depth + 1;
4875
                    cg->stackDepth = depth + 1;
4876
4876
4877
                    /*
4877
                    /*
4878
                     * Move exception back to cx->exception to prepare for
4878
                     * Move exception back to cx->exception to prepare for
4879
                     * the next catch.
4879
                     * the next catch. We hide [throwing] from the decompiler
4880
                     * since it compensates for the hidden JSOP_DUP at the
4881
                     * start of the previous guarded catch.
4880
                     */
4882
                     */
4881
                    if (!js_Emit1(cx, cg, JSOP_THROWING) < 0)
4883
                    if (js_NewSrcNote(cx, cg, SRC_HIDDEN) < 0 ||
4884
                        js_Emit1(cx, cg, JSOP_THROWING) < 0) {
4882
                        return JS_FALSE;
4885
                        return JS_FALSE;
4886
                    }
4883
4887
4884
                    /*
4888
                    /*
4885
                     * Emit an unbalanced [leaveblock] for the previous catch,
4889
                     * Emit an unbalanced [leaveblock] for the previous catch,
4886
                     * whose block object count is saved below.
4890
                     * whose block object count is saved below.
4887
                     */
4891
                     */
4888
                    if (js_NewSrcNote(cx, cg, SRC_HIDDEN) < 0)
4892
                    if (js_NewSrcNote(cx, cg, SRC_HIDDEN) < 0)
4889
                        return JS_FALSE;
4893
                        return JS_FALSE;
(-)jsopcode.c (-4 / +5 lines)
Line     Link Here 
 Lines 2376-2395   Decompile(SprintStack *ss, jsbytecode *p Link Here 
2376
2376
2377
                    pc2 = pc;
2377
                    pc2 = pc;
2378
                    pc += oplen;
2378
                    pc += oplen;
2379
                    LOCAL_ASSERT(*pc == JSOP_EXCEPTION);
2379
                    LOCAL_ASSERT(*pc == JSOP_EXCEPTION);
2380
                    pc += JSOP_EXCEPTION_LENGTH;
2380
                    pc += JSOP_EXCEPTION_LENGTH;
2381
                    if (*pc == JSOP_DUP) {
2381
                    if (*pc == JSOP_DUP) {
2382
                        sn2 = js_GetSrcNote(jp->script, pc);
2382
                        sn2 = js_GetSrcNote(jp->script, pc);
2383
                        if (sn2) {
2383
                        if (sn2 && SN_TYPE(sn2) == SRC_HIDDEN) {
2384
                            /*
2384
                            /*
2385
                             * A dup that pushes the exception object to use
2385
                             * This is a hidden dup to save the exception for
2386
                             * after if the exception guard is false.
2386
                             * later. It must exist only when the catch has
2387
                             * an exception guard.
2387
                             */
2388
                             */
2388
                            LOCAL_ASSERT(SN_TYPE(sn2) == SRC_HIDDEN);
2389
                            LOCAL_ASSERT(js_GetSrcNoteOffset(sn, 0) != 0);
2389
                            pc += JSOP_DUP_LENGTH;
2390
                            pc += JSOP_DUP_LENGTH;
2390
                        }
2391
                        }
2391
                    }
2392
                    }
2392
#if JS_HAS_DESTRUCTURING
2393
#if JS_HAS_DESTRUCTURING
2393
                    if (*pc == JSOP_DUP) {
2394
                    if (*pc == JSOP_DUP) {
2394
                        pc = DecompileDestructuring(ss, pc, endpc);
2395
                        pc = DecompileDestructuring(ss, pc, endpc);
2395
                        if (!pc) {
2396
                        if (!pc) {

Return to bug 374589