Restrict global checks to the TR's global (bug 597940 followup, r=luke).

This commit is contained in:
David Anderson 2011-01-07 16:54:55 -08:00
parent 21bab7c739
commit 28d275b6fc

View File

@ -1594,6 +1594,7 @@ class TraceRecorder
TreeFragment* getTree() const { return tree; }
bool outOfMemory() const { return traceMonitor->outOfMemory(); }
Oracle* getOracle() const { return oracle; }
JSObject* getGlobal() const { return globalObj; }
/* Entry points / callbacks from the interpreter. */
JS_REQUIRES_STACK AbortableRecordingStatus monitorRecording(JSOp op);
@ -1881,7 +1882,7 @@ AbortRecordingIfUnexpectedGlobalWrite(JSContext *cx, JSObject *obj, unsigned slo
{
#ifdef JS_TRACER
if (TraceRecorder *tr = TRACE_RECORDER(cx)) {
if (!obj->parent && !tr->globalSetExpected(slot))
if (obj == tr->getGlobal() && !tr->globalSetExpected(slot))
AbortRecording(cx, "Global slot written outside tracer supervision");
}
#endif