Bug 1211962 - addNativeToBytecodeEntry: Check that the masm.currentOffset() returns a valid result. r=djvj

This commit is contained in:
Nicolas B. Pierron 2015-10-07 11:55:09 +02:00
Родитель e7aabfcb3a
Коммит c1ecd2ffc8
2 изменённых файлов: 16 добавлений и 0 удалений

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

@ -0,0 +1,11 @@
// |jit-test| slow;
load(libdir + "oomTest.js");
enableSPSProfiling();
var lfGlobal = newGlobal();
for (lfLocal in this) {
lfGlobal[lfLocal] = this[lfLocal];
}
const script = 'oomTest(() => getBacktrace({args: true, locals: "123795", thisprops: true}));';
lfGlobal.offThreadCompileScript(script);
lfGlobal.runOffThreadScript();

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

@ -208,6 +208,11 @@ CodeGeneratorShared::addNativeToBytecodeEntry(const BytecodeSite* site)
if (!isProfilerInstrumentationEnabled())
return true;
// Fails early if the last added instruction caused the macro assembler to
// run out of memory as continuity assumption below do not hold.
if (masm.oom())
return false;
MOZ_ASSERT(site);
MOZ_ASSERT(site->tree());
MOZ_ASSERT(site->pc());