Bug 1264948 - MBasicBlock::inherit, check for OOMs when allocating Phi nodes. r=h4writer

This commit is contained in:
Nicolas B. Pierron 2016-06-15 16:27:18 +00:00
parent 9676f23598
commit 1710de95c9

View File

@ -558,7 +558,9 @@ MBasicBlock::inherit(TempAllocator& alloc, BytecodeAnalysis* analysis, MBasicBlo
if (kind_ == PENDING_LOOP_HEADER) {
size_t i = 0;
for (i = 0; i < info().firstStackSlot(); i++) {
MPhi* phi = MPhi::New(alloc);
MPhi* phi = MPhi::New(alloc.fallible());
if (!phi)
return false;
phi->addInlineInput(pred->getSlot(i));
addPhi(phi);
setSlot(i, phi);
@ -578,7 +580,9 @@ MBasicBlock::inherit(TempAllocator& alloc, BytecodeAnalysis* analysis, MBasicBlo
}
for (; i < stackDepth(); i++) {
MPhi* phi = MPhi::New(alloc);
MPhi* phi = MPhi::New(alloc.fallible());
if (!phi)
return false;
phi->addInlineInput(pred->getSlot(i));
addPhi(phi);
setSlot(i, phi);