Bug 998355. r=jonco
authorTerrence Cole <terrence@mozilla.com>
Wed, 23 Apr 2014 15:39:56 -0700
changeset 180430 5c026fd7e73c1b8bfcda08deae60434a0d24ef61
parent 180429 891fc0052015ba36d976dca083ceec5a5af35aa2
child 180431 d5a514b9a0db31234c541fb0bdf65d72a2afee9e
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersjonco
bugs998355
milestone31.0a1
Bug 998355. r=jonco
js/src/jsweakmap.h
--- a/js/src/jsweakmap.h
+++ b/js/src/jsweakmap.h
@@ -184,20 +184,20 @@ class WeakMap : public HashMap<Key, Valu
             /* If the entry is live, ensure its key and value are marked. */
             Key key(e.front().key());
             if (gc::IsMarked(const_cast<Key *>(&key))) {
                 if (markValue(trc, &e.front().value()))
                     markedAny = true;
                 if (e.front().key() != key)
                     entryMoved(e, key);
             } else if (keyNeedsMark(key)) {
+                gc::Mark(trc, &e.front().value(), "WeakMap entry value");
                 gc::Mark(trc, &key, "proxy-preserved WeakMap entry key");
                 if (e.front().key() != key)
                     entryMoved(e, key);
-                gc::Mark(trc, &e.front().value(), "WeakMap entry value");
                 markedAny = true;
             }
             key.unsafeSet(nullptr);
         }
         return markedAny;
     }
 
     void sweep() {