Bug 460180 - Always reload pn1 since it is null if we found the end of the list. r=brendan
authorBlake Kaplan <mrbkap@gmail.com>
Wed, 15 Oct 2008 21:35:18 -0700
changeset 20911 49d185d8fef0c67aeff681b14afc3e38e82975be
parent 20910 7b98ea7f523ce434f42918e68cec063cc61a86a1
child 20913 dfaf9c49cb913947350a0cde8eb068ff965a1331
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbrendan
bugs460180
milestone1.9.1b2pre
Bug 460180 - Always reload pn1 since it is null if we found the end of the list. r=brendan
js/src/jsparse.cpp
--- a/js/src/jsparse.cpp
+++ b/js/src/jsparse.cpp
@@ -6511,18 +6511,18 @@ js_FoldConstants(JSContext *cx, JSParseN
                         RecycleTree(pn1, tc);
                         --pn->pn_count;
                     } else {
                         pnp = &pn1->pn_next;
                     }
                 } while ((pn1 = *pnp) != NULL);
 
                 // We may have to change arity from LIST to BINARY.
+                pn1 = pn->pn_head;
                 if (pn->pn_count == 2) {
-                    pn1 = pn->pn_head;
                     pn2 = pn1->pn_next;
                     pn1->pn_next = NULL;
                     JS_ASSERT(!pn2->pn_next);
                     pn->pn_arity = PN_BINARY;
                     pn->pn_left = pn1;
                     pn->pn_right = pn2;
                 } else if (pn->pn_count == 1) {
                     PN_MOVE_NODE(pn, pn1);