diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-04-08 18:16:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-08 18:16:01 +0200 |
commit | 6ac47e95318efb654682ed774fbbde1eb0fa2dd3 (patch) | |
tree | 05e3594dc85fd66d29d122184157901fe7e51837 /js/xpconnect/src/XPCVariant.cpp | |
parent | bf6bb142fc5bcb49b053788e06160af304f639e5 (diff) | |
parent | bbd4001cb261cc54e2adf804ea7cbeb09078d7d9 (diff) | |
download | UXP-6ac47e95318efb654682ed774fbbde1eb0fa2dd3.tar UXP-6ac47e95318efb654682ed774fbbde1eb0fa2dd3.tar.gz UXP-6ac47e95318efb654682ed774fbbde1eb0fa2dd3.tar.lz UXP-6ac47e95318efb654682ed774fbbde1eb0fa2dd3.tar.xz UXP-6ac47e95318efb654682ed774fbbde1eb0fa2dd3.zip |
Merge pull request #94 from trav90/js-work
Fix Value::isGCThing footgun, stop returning true for NullValue
Diffstat (limited to 'js/xpconnect/src/XPCVariant.cpp')
-rw-r--r-- | js/xpconnect/src/XPCVariant.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/js/xpconnect/src/XPCVariant.cpp b/js/xpconnect/src/XPCVariant.cpp index a3d2b88c5..4c1230172 100644 --- a/js/xpconnect/src/XPCVariant.cpp +++ b/js/xpconnect/src/XPCVariant.cpp @@ -55,7 +55,7 @@ XPCTraceableVariant::~XPCTraceableVariant() { Value val = GetJSValPreserveColor(); - MOZ_ASSERT(val.isGCThing(), "Must be traceable or unlinked"); + MOZ_ASSERT(val.isGCThing() || val.isNull(), "Must be traceable or unlinked"); mData.Cleanup(); @@ -65,7 +65,7 @@ XPCTraceableVariant::~XPCTraceableVariant() void XPCTraceableVariant::TraceJS(JSTracer* trc) { - MOZ_ASSERT(GetJSValPreserveColor().isMarkable()); + MOZ_ASSERT(GetJSValPreserveColor().isGCThing()); JS::TraceEdge(trc, &mJSVal, "XPCTraceableVariant::mJSVal"); } @@ -86,7 +86,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(XPCVariant) tmp->mData.Cleanup(); - if (val.isMarkable()) { + if (val.isGCThing()) { XPCTraceableVariant* v = static_cast<XPCTraceableVariant*>(tmp); v->RemoveFromRootSet(); } @@ -99,7 +99,7 @@ XPCVariant::newVariant(JSContext* cx, const Value& aJSVal) { RefPtr<XPCVariant> variant; - if (!aJSVal.isMarkable()) + if (!aJSVal.isGCThing()) variant = new XPCVariant(cx, aJSVal); else variant = new XPCTraceableVariant(cx, aJSVal); |