Bug 1263862 - Fix OOM case in ScopeIter::settle. r=jandem

This commit is contained in:
Shu-yu Guo 2016-04-19 19:44:00 +02:00
Родитель 5facb5e7d0
Коммит c77388a279
2 изменённых файлов: 8 добавлений и 2 удалений

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

@ -0,0 +1,6 @@
function loadFile(lfVarx) {
oomTest(() => eval(lfVarx));
}
for (var i = 0; i < 10; ++i) {
loadFile(`"use strict"; const s = () => s;`);
}

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

@ -1459,8 +1459,8 @@ ScopeIter::settle()
// function frame case above, if the script starts with a lexical
// block, the SSI could see 2 block scopes here. So skip between 1-2
// static block scopes here.
MOZ_ASSERT(ssi_.type() == StaticScopeIter<CanGC>::Block);
incrementStaticScopeIter();
if (ssi_.type() == StaticScopeIter<CanGC>::Block)
incrementStaticScopeIter();
if (ssi_.type() == StaticScopeIter<CanGC>::Block)
incrementStaticScopeIter();
MOZ_ASSERT(ssi_.type() == StaticScopeIter<CanGC>::Eval);