Bad assert in NEXTITER exception handling (494975, r=brendan).
authorAndreas Gal <gal@mozilla.com>
Tue, 26 May 2009 16:39:43 -0700
changeset 28812 be2c8bf0824c6bfe5faabe77add350cd4fe85571
parent 28811 edb390c96ca463303819833792464eeb6902c0ab
child 28813 5b0eb5022f03a9f0e0f74da79c0a036bb20155ed
push id7273
push userrsayre@mozilla.com
push dateThu, 28 May 2009 22:52:43 +0000
treeherdermozilla-central@ac3e487c5fff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbrendan
bugs494975
milestone1.9.2a1pre
Bad assert in NEXTITER exception handling (494975, r=brendan).
js/src/jsinterp.cpp
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -7111,26 +7111,24 @@ js_Interpret(JSContext *cx)
 #if !JS_THREADED_INTERP
         } /* switch (op) */
     } /* for (;;) */
 #endif /* !JS_THREADED_INTERP */
 
   error:
     if (fp->imacpc && cx->throwing) {
         // To keep things simple, we hard-code imacro exception handlers here.
-        if (*fp->imacpc == JSOP_NEXTITER) {
+        if (*fp->imacpc == JSOP_NEXTITER && js_ValueIsStopIteration(cx->exception)) {
             // pc may point to JSOP_DUP here due to bug 474854.
             JS_ASSERT(*regs.pc == JSOP_CALL || *regs.pc == JSOP_DUP || *regs.pc == JSOP_TRUE);
-            if (js_ValueIsStopIteration(cx->exception)) {
-                cx->throwing = JS_FALSE;
-                cx->exception = JSVAL_VOID;
-                regs.sp[-1] = JSVAL_HOLE;
-                PUSH(JSVAL_FALSE);
-                goto end_imacro;
-            }
+            cx->throwing = JS_FALSE;
+            cx->exception = JSVAL_VOID;
+            regs.sp[-1] = JSVAL_HOLE;
+            PUSH(JSVAL_FALSE);
+            goto end_imacro;
         }
 
         // Handle other exceptions as if they came from the imacro-calling pc.
         regs.pc = fp->imacpc;
         fp->imacpc = NULL;
         atoms = script->atomMap.vector;
     }