Bug 601102 - Stop building exception backtrace at compartment boundaries (r=gal,a=dveditz)
authorLuke Wagner <luke@mozilla.com>
Fri, 25 Mar 2011 18:22:49 -0700
changeset 199584 cbda245a805d69d0d3b866381474b852ce078365
parent 199583 70e0a1a2da2105e011f7d1d99a7ee51bb09bdc69
child 199585 cc6343052a964929b6504b30702c8bfe2007795b
push id1
push userraliiev@mozilla.com
push dateMon, 14 Jul 2014 20:22:58 +0000
treeherdermozilla-esr31@450086c0ded0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal, dveditz
bugs601102
milestone2.0pre
Bug 601102 - Stop building exception backtrace at compartment boundaries (r=gal,a=dveditz)
js/src/jsexn.cpp
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -291,16 +291,18 @@ InitExnPrivate(JSContext *cx, JSObject *
                   : NULL;
     older = JS_SetErrorReporter(cx, NULL);
     state = JS_SaveExceptionState(cx);
 
     callerid = ATOM_TO_JSID(cx->runtime->atomState.callerAtom);
     stackDepth = 0;
     valueCount = 0;
     for (fp = js_GetTopStackFrame(cx); fp; fp = fp->prev()) {
+        if (fp->scopeChain().compartment() != cx->compartment)
+            break;
         if (fp->isFunctionFrame() && !fp->isEvalFrame()) {
             Value v = NullValue();
             if (checkAccess &&
                 !checkAccess(cx, &fp->callee(), callerid, JSACC_READ, &v)) {
                 break;
             }
             valueCount += fp->numActualArgs();
         }
@@ -332,16 +334,18 @@ InitExnPrivate(JSContext *cx, JSObject *
     priv->message = message;
     priv->filename = filename;
     priv->lineno = lineno;
     priv->stackDepth = stackDepth;
 
     values = GetStackTraceValueBuffer(priv);
     elem = priv->stackElems;
     for (fp = js_GetTopStackFrame(cx); fp != fpstop; fp = fp->prev()) {
+        if (fp->scopeChain().compartment() != cx->compartment)
+            break;
         if (!fp->isFunctionFrame() || fp->isEvalFrame()) {
             elem->funName = NULL;
             elem->argc = 0;
         } else {
             elem->funName = fp->fun()->atom
                             ? ATOM_TO_STRING(fp->fun()->atom)
                             : cx->runtime->emptyString;
             elem->argc = fp->numActualArgs();