Bug 887334 - Null-check compartment() in JS_GetGlobalForScopeChain(). r=luke

cx->global() assumes a non-null compartment(). When we fix up various bugs
related to being in a compartment when we shouldn't be, we start to crash here.
Fix it.
This commit is contained in:
Bobby Holley 2013-07-17 11:53:51 -07:00
parent a5bbbb322d
commit 36f005e12f

View File

@ -2087,6 +2087,8 @@ JS_GetGlobalForScopeChain(JSContext *cx)
{
AssertHeapIsIdleOrIterating(cx);
CHECK_REQUEST(cx);
if (!cx->compartment())
return NULL;
return cx->global();
}