Bug 1399866 - Assert proxy private is not gray on creation r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Mon, 18 Dec 2017 09:59:21 +0000
changeset 448465 dd94a26765f341a9fefa55b05c46f5dfe3c13498
parent 448464 59a2346b07f79d42cc473efdf64bfa207e04b148
child 448466 62afafe1b3d99052bb2f4f5589a79f2acf40c223
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1399866
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1399866 - Assert proxy private is not gray on creation r=sfink
js/src/vm/ProxyObject.cpp
--- a/js/src/vm/ProxyObject.cpp
+++ b/js/src/vm/ProxyObject.cpp
@@ -51,16 +51,17 @@ ProxyObject::New(JSContext* cx, const Ba
     Rooted<TaggedProto> proto(cx, proto_);
 
     const Class* clasp = options.clasp();
 
     MOZ_ASSERT(isValidProxyClass(clasp));
     MOZ_ASSERT(clasp->shouldDelayMetadataBuilder());
     MOZ_ASSERT_IF(proto.isObject(), cx->compartment() == proto.toObject()->compartment());
     MOZ_ASSERT(clasp->hasFinalize());
+    MOZ_ASSERT_IF(priv.isGCThing(), !JS::GCThingIsMarkedGray(JS::GCCellPtr(priv)));
 
     /*
      * Eagerly mark properties unknown for proxies, so we don't try to track
      * their properties and so that we don't need to walk the compartment if
      * their prototype changes later.  But don't do this for DOM proxies,
      * because we want to be able to keep track of them in typesets in useful
      * ways.
      */