Bug 1210607 - Check for null compartment in PopulateReportBlame() r=terrence

This commit is contained in:
Jon Coppeard 2015-10-05 10:50:41 +01:00
Родитель 08c32a7a8c
Коммит 46c8da5401
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,9 @@
// |jit-test| allow-oom
if (!('oomAfterAllocations' in this))
quit();
var g = newGlobal();
x = Debugger(g);
selectforgc(g);
oomAfterAllocations(0);

Просмотреть файл

@ -252,11 +252,15 @@ ReportError(JSContext* cx, const char* message, JSErrorReport* reportp,
static void
PopulateReportBlame(JSContext* cx, JSErrorReport* report)
{
JSCompartment* compartment = cx->compartment();
if (!compartment)
return;
/*
* Walk stack until we find a frame that is associated with a non-builtin
* rather than a builtin frame and which we're allowed to know about.
*/
NonBuiltinFrameIter iter(cx, cx->compartment()->principals());
NonBuiltinFrameIter iter(cx, compartment->principals());
if (iter.done())
return;