Fix goof in switching from word to jsval counters.
authorBrendan Eich <brendan@mozilla.org>
Wed, 28 May 2008 23:12:45 -0700
changeset 17183 bd1d2405ea5ecf6592cbeb4ff9b5682b7cc5cdec
parent 17182 8019f065443a8ada678b2f8f1efcd8f5ed2c3350
child 17184 5eee494d5f061157f47c00d9c76605c00fb7b7d5
child 17193 da54ae4ebb7c3adcf89174796f39ee3494cc9f8b
push id1452
push usershaver@mozilla.com
push dateFri, 22 Aug 2008 00:08:22 +0000
treeherdermozilla-central@d13bb0868596 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a1pre
Fix goof in switching from word to jsval counters.
js/src/jsinterp.cpp
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -2798,18 +2798,23 @@ JS_INTERPRET(JSContext *cx)
           ADD_EMPTY_CASE(JSOP_STARTXML)
           ADD_EMPTY_CASE(JSOP_STARTXMLEXPR)
 #endif
           END_EMPTY_CASES
 
           BEGIN_CASE(JSOP_HEADER)
             i = GET_UINT8(regs.pc);
             vp = &fp->spbase[-1 - i];
-            JS_ASSERT(JSVAL_IS_INT(*vp));
-            *vp += 2;
+            lval = *vp;
+            if (JSVAL_IS_NULL(lval)) {
+                *vp = JSVAL_ONE;
+            } else {
+                JS_ASSERT(JSVAL_IS_INT(lval));
+                *vp = lval + 2;
+            }
           END_CASE(JSOP_HEADER)
 
           /* ADD_EMPTY_CASE is not used here as JSOP_LINENO_LENGTH == 3. */
           TRACE_CASE(JSOP_LINENO)
           END_CASE(JSOP_LINENO)
 
           TRACE_CASE(JSOP_PUSH)
             PUSH_STACK_CONSTANT(JSVAL_VOID);