Bug 784282 - GC: Assert that cross-compartment pointers are wrapped when marking r=billm

This commit is contained in:
Jon Coppeard 2012-08-22 10:45:37 +01:00
parent 1a47184b94
commit 7fc41759f9

View File

@ -1160,11 +1160,14 @@ GCMarker::processMarkStackTop(SliceBudget &budget)
if (v.isString()) {
JSString *str = v.toString();
JS_COMPARTMENT_ASSERT_STR(runtime, str);
if (str->markIfUnmarked())
JS_ASSERT(str->compartment() == runtime->atomsCompartment ||
str->compartment() == obj->compartment());
if (str->markIfUnmarked())
ScanString(this, str);
} else if (v.isObject()) {
JSObject *obj2 = &v.toObject();
JS_COMPARTMENT_ASSERT(runtime, obj2);
JS_ASSERT(obj->compartment() == obj2->compartment());
if (obj2->markIfUnmarked(getMarkColor())) {
pushValueArray(obj, vp, end);
obj = obj2;