Fix Value::isGCThing footgun, stop returning true for NullValue

This commit is contained in:
trav90 2018-04-07 12:24:30 -05:00 • committed by Roy Tam
commit 10b24b8110
31 changed files with 87 additions and 103 deletions

View file

@ -45,7 +45,7 @@ ProxyObject::New(JSContext* cx, const BaseProxyHandler* handler, HandleValue pri
// wrappee. Prefer to allocate in the nursery, when possible.
NewObjectKind newKind = NurseryAllocatedProxy;
if (options.singleton()) {
MOZ_ASSERT(priv.isGCThing() && priv.toGCThing()->isTenured());
MOZ_ASSERT(priv.isNull() || (priv.isGCThing() && priv.toGCThing()->isTenured()));
newKind = SingletonObject;
} else if ((priv.isGCThing() && priv.toGCThing()->isTenured()) ||
!handler->canNurseryAllocate() ||