Bug 880697 - Push in a few other suspicious places. r=gabor

This commit is contained in:
Bobby Holley 2013-06-12 14:17:56 -07:00
parent b7f1411be5
commit e6c8230633
2 changed files with 7 additions and 8 deletions

View File

@ -10,6 +10,9 @@
#include "jsd.h"
#include "jsfriendapi.h"
#include "nsCxPusher.h"
using mozilla::AutoPushJSContext;
#ifdef DEBUG
void JSD_ASSERT_VALID_THREAD_STATE(JSDThreadState* jsdthreadstate)
@ -398,7 +401,6 @@ jsd_EvaluateUCScriptInStackFrame(JSDContext* jsdc,
JSBool retval;
JSBool valid;
JSExceptionState* exceptionState = NULL;
JSContext* cx;
JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
@ -409,7 +411,7 @@ jsd_EvaluateUCScriptInStackFrame(JSDContext* jsdc,
if( ! valid )
return JS_FALSE;
cx = jsdthreadstate->context;
AutoPushJSContext cx(jsdthreadstate->context);
JS_ASSERT(cx);
if (eatExceptions)
@ -436,7 +438,6 @@ jsd_EvaluateScriptInStackFrame(JSDContext* jsdc,
JSBool retval;
JSBool valid;
JSExceptionState* exceptionState = NULL;
JSContext *cx;
JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
@ -447,7 +448,7 @@ jsd_EvaluateScriptInStackFrame(JSDContext* jsdc,
if (!valid)
return JS_FALSE;
cx = jsdthreadstate->context;
AutoPushJSContext cx(jsdthreadstate->context);
JS_ASSERT(cx);
if (eatExceptions)

View File

@ -36,6 +36,7 @@
#include "nsCxPusher.h"
using mozilla::AutoSafeJSContext;
using mozilla::AutoPushJSContext;
/*
* defining CAUTIOUS_SCRIPTHOOK makes jsds disable GC while calling out to the
@ -2001,16 +2002,13 @@ jsdStackFrame::Eval (const nsAString &bytes, const nsACString &fileName,
JSExceptionState *estate = 0;
JSContext *cx = JSD_GetJSContext (mCx, mThreadState);
AutoPushJSContext cx(JSD_GetJSContext (mCx, mThreadState));
JS::RootedValue jv(cx);
estate = JS_SaveExceptionState (cx);
JS_ClearPendingException (cx);
nsCxPusher pusher;
pusher.Push(cx);
*_rval = JSD_AttemptUCScriptInStackFrame (mCx, mThreadState,
mStackFrameInfo,
char_bytes, bytes.Length(),