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

This commit is contained in:
brendan%mozilla.org 2007-02-12 19:08:50 +00:00
Родитель 21437c421a
Коммит d65c77ad9b
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -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 &&