From 1491318f84053eb07a9e29c1efba64b14fe131e5 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Tue, 14 Sep 2010 14:38:09 -0700 Subject: [PATCH] Bug 580033 - JS_Save/RestoreFrameChain should update cx->compartment. r=gal,mrbkap. --HG-- extra : rebase_source : ff05faf1a39513255bcd6218b0adf6ab554a30b1 --- js/src/jscntxt.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h index b5156ba98d5e..515f8f9347dc 100644 --- a/js/src/jscntxt.h +++ b/js/src/jscntxt.h @@ -2089,6 +2089,9 @@ struct JSContext /* 'regs' must only be changed by calling this function. */ void setCurrentRegs(JSFrameRegs *regs) { this->regs = regs; + + JSObject *obj = JS_GetGlobalForScopeChain(this); + compartment = obj ? obj->getCompartment(this) : runtime->defaultCompartment; } /* Temporary arena pool used while compiling and decompiling. */