Bug 1368570 - Fix js::FinishCompilation to handle OOM correctly. r=nbp

This commit is contained in:
Jan de Mooij 2017-06-02 18:42:06 +02:00
Родитель 8f33388e7a
Коммит 31e118ed1f
1 изменённых файлов: 2 добавлений и 4 удалений

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

@ -1481,10 +1481,8 @@ js::FinishCompilation(JSContext* cx, HandleScript script, CompilerConstraintList
// Add this compilation to the inlinedCompilations list of each inlined
// script, so we can invalidate it on changes to stack type sets.
if (entry.script != script) {
if (!entry.script->types()->addInlinedCompilation(*precompileInfo)) {
ReportOutOfMemory(cx);
return false;
}
if (!entry.script->types()->addInlinedCompilation(*precompileInfo))
succeeded = false;
}
// If necessary, add constraints to trigger invalidation on the script