Fix from Mats Palmgren <mats.palmgren@bredband.net> for 369805, r=me.

git-svn-id: svn://10.0.0.236/trunk@219985 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
brendan%mozilla.org
2007-02-12 19:08:50 +00:00
parent dc147d63dd
commit 632dae6f4f

View File

@@ -1242,6 +1242,15 @@ js_LockObj(JSContext *cx, JSObject *obj)
JSScope *scope;
JS_ASSERT(OBJ_IS_NATIVE(obj));
/*
* We must test whether the GC is calling and return without mutating any
* state, especially cx->lockedSealedScope. Note asymmetry with respect to
* js_UnlockObj, which is a thin-layer on top of js_UnlockScope.
*/
if (CX_THREAD_IS_RUNNING_GC(cx))
return;
for (;;) {
scope = OBJ_SCOPE(obj);
if (SCOPE_IS_SEALED(scope) && scope->object == obj &&