From e0cd11d3d6cffd1e9b5a18e6d76c9ad4e48c4022 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Fri, 25 Mar 2011 18:22:49 -0700 Subject: [PATCH] Bug 601102 - Stop building exception backtrace at compartment boundaries (r=gal) --- js/src/jsexn.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp index 10edf66b748..7e881859314 100644 --- a/js/src/jsexn.cpp +++ b/js/src/jsexn.cpp @@ -296,6 +296,8 @@ InitExnPrivate(JSContext *cx, JSObject *exnObject, JSString *message, 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 && @@ -337,6 +339,8 @@ InitExnPrivate(JSContext *cx, JSObject *exnObject, JSString *message, 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;