Bug 580033 - JS_Save/RestoreFrameChain should update cx->compartment. r=gal.

--HG--
extra : rebase_source : e063e91c61f159c98ac4f8f0e3bb74eceee069e6
This commit is contained in:
Jason Orendorff 2010-07-19 18:04:50 -05:00
Родитель 3dd9f9600b
Коммит 2c34e0d185
1 изменённых файлов: 3 добавлений и 0 удалений

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

@ -2087,6 +2087,7 @@ JSContext::saveActiveCallStack()
JS_ASSERT(fp->savedPC == JSStackFrame::sInvalidPC);
fp->savedPC = regs->pc;
setCurrentFrame(NULL);
compartment = globalObject ? globalObject->getCompartment(this) : runtime->defaultCompartment;
setCurrentRegs(NULL);
}
@ -2095,6 +2096,8 @@ JSContext::restoreCallStack()
{
js::CallStack *ccs = currentCallStack;
setCurrentFrame(ccs->getSuspendedFrame());
JSObject *obj = JS_GetGlobalForScopeChain(this);
compartment = obj ? obj->getCompartment(this) : runtime->defaultCompartment;
setCurrentRegs(ccs->getSuspendedRegs());
ccs->restore();
#ifdef DEBUG