Bug 488690 - "Assertion failure: dn->pn_defn, at ../jsemit.cpp" (r=mrbkap).
authorBrendan Eich <brendan@mozilla.org>
Mon, 20 Apr 2009 15:51:27 -0700
changeset 27574 ed4ac8a1494e68dfbb4277b41c3170f1e25fe53a
parent 27573 77a2e94b0262cc9a7c21ee7d2f80580b025a9350
child 27575 cbd386ceb77f575243e363c373c8299c90dace39
push id6623
push userrsayre@mozilla.com
push dateTue, 21 Apr 2009 18:35:23 +0000
treeherdermozilla-central@30ac20416be4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs488690
milestone1.9.2a1pre
Bug 488690 - "Assertion failure: dn->pn_defn, at ../jsemit.cpp" (r=mrbkap).
js/src/jsparse.cpp
--- a/js/src/jsparse.cpp
+++ b/js/src/jsparse.cpp
@@ -6133,17 +6133,19 @@ CompExprTransplanter::transplant(JSParse
             if (genexp && PN_OP(dn) != JSOP_CALLEE) {
                 JS_ASSERT(!tc->decls.lookup(atom));
 
                 if (dn->pn_pos < root->pn_pos || dn->isPlaceholder()) {
                     JSAtomListElement *ale = tc->lexdeps.add(tc->compiler, dn->pn_atom);
                     if (!ale)
                         return NULL;
 
-                    if (!dn->isPlaceholder()) {
+                    if (dn->pn_pos >= root->pn_pos) {
+                        tc->parent->lexdeps.remove(tc->compiler, atom);
+                    } else {
                         JSDefinition *dn2 = (JSDefinition *)
                             NewNameNode(tc->compiler->context, TS(tc->compiler), dn->pn_atom, tc);
                         if (!dn2)
                             return NULL;
 
                         dn2->pn_type = dn->pn_type;
                         dn2->pn_pos = dn->pn_pos;
                         dn2->pn_defn = true;
@@ -6159,19 +6161,16 @@ CompExprTransplanter::transplant(JSParse
                         dn2->dn_uses = dn->dn_uses;
                         dn->dn_uses = *pnup;
                         *pnup = NULL;
 
                         dn = dn2;
                     }
 
                     ALE_SET_DEFN(ale, dn);
-
-                    if (dn->pn_pos >= root->pn_pos)
-                        tc->parent->lexdeps.remove(tc->compiler, atom);
                 }
             }
         }
 
         if (pn->pn_pos >= root->pn_pos)
             pn->pn_blockid += adjust;
         break;