Bug 1143706 - Allow BaseShape's global to be null when tracing r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Tue, 17 Mar 2015 10:22:36 +0000
changeset 251105 aede36df2ed98e680d25cd522aed894c4c8a2a92
parent 251104 757de8e339e038b0ef6faa6239c38fd52313f13a
child 251106 15e49729e473ded4ea41c16a6b7dab0143674703
push id1096
push userbcampen@mozilla.com
push dateTue, 17 Mar 2015 18:28:18 +0000
reviewersterrence
bugs1143706
milestone39.0a1
Bug 1143706 - Allow BaseShape's global to be null when tracing r=terrence
js/src/gc/Marking.cpp
js/src/jit-test/tests/gc/bug-1143706.js
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -1063,18 +1063,18 @@ ScanBaseShape(GCMarker *gcmarker, BaseSh
 
 void
 BaseShape::markChildren(JSTracer *trc)
 {
     if (isOwned())
         gc::MarkBaseShape(trc, &unowned_, "base");
 
     JSObject* global = compartment()->unsafeUnbarrieredMaybeGlobal();
-    MOZ_ASSERT(global);
-    MarkObjectUnbarriered(trc, &global, "global");
+    if (global)
+        MarkObjectUnbarriered(trc, &global, "global");
 
     if (metadata)
         gc::MarkObject(trc, &metadata, "metadata");
 }
 
 static void
 PushMarkStack(GCMarker *gcmarker, BaseShape *thing)
 {
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/gc/bug-1143706.js
@@ -0,0 +1,2 @@
+gczeal(14, 1);
+var g = newGlobal();