зеркало из https://github.com/mozilla/pjs.git
Preserve invariant between saved array and lifetime variables' saved fields on OOM during analysis, bug 735045. r=luke
This commit is contained in:
Родитель
e483eb5ff5
Коммит
63b74ed81b
|
@ -1048,13 +1048,14 @@ ScriptAnalysis::killVariable(JSContext *cx, LifetimeVariable &var, unsigned offs
|
||||||
{
|
{
|
||||||
if (!var.lifetime) {
|
if (!var.lifetime) {
|
||||||
/* Make a point lifetime indicating the write. */
|
/* Make a point lifetime indicating the write. */
|
||||||
if (!var.saved)
|
Lifetime *lifetime = cx->typeLifoAlloc().new_<Lifetime>(offset, var.savedEnd, var.saved);
|
||||||
saved[savedCount++] = &var;
|
if (!lifetime) {
|
||||||
var.saved = cx->typeLifoAlloc().new_<Lifetime>(offset, var.savedEnd, var.saved);
|
|
||||||
if (!var.saved) {
|
|
||||||
setOOM(cx);
|
setOOM(cx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!var.saved)
|
||||||
|
saved[savedCount++] = &var;
|
||||||
|
var.saved = lifetime;
|
||||||
var.saved->write = true;
|
var.saved->write = true;
|
||||||
var.savedEnd = 0;
|
var.savedEnd = 0;
|
||||||
return;
|
return;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче