зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1264948 - MBasicBlock::addPredecessor, check for OOMs when allocating Phi nodes. r=h4writer
This commit is contained in:
Родитель
6bf999e76d
Коммит
c1242e255e
|
@ -7548,6 +7548,9 @@ class MPhi final
|
||||||
static MPhi* New(TempAllocator& alloc, MIRType resultType = MIRType::Value) {
|
static MPhi* New(TempAllocator& alloc, MIRType resultType = MIRType::Value) {
|
||||||
return new(alloc) MPhi(alloc, resultType);
|
return new(alloc) MPhi(alloc, resultType);
|
||||||
}
|
}
|
||||||
|
static MPhi* New(TempAllocator::Fallible alloc, MIRType resultType = MIRType::Value) {
|
||||||
|
return new(alloc) MPhi(alloc.alloc, resultType);
|
||||||
|
}
|
||||||
|
|
||||||
void removeOperand(size_t index);
|
void removeOperand(size_t index);
|
||||||
void removeAllOperands();
|
void removeAllOperands();
|
||||||
|
|
|
@ -1193,9 +1193,11 @@ MBasicBlock::addPredecessorPopN(TempAllocator& alloc, MBasicBlock* pred, uint32_
|
||||||
// Otherwise, create a new phi node.
|
// Otherwise, create a new phi node.
|
||||||
MPhi* phi;
|
MPhi* phi;
|
||||||
if (mine->type() == other->type())
|
if (mine->type() == other->type())
|
||||||
phi = MPhi::New(alloc, mine->type());
|
phi = MPhi::New(alloc.fallible(), mine->type());
|
||||||
else
|
else
|
||||||
phi = MPhi::New(alloc);
|
phi = MPhi::New(alloc.fallible());
|
||||||
|
if (!phi)
|
||||||
|
return false;
|
||||||
addPhi(phi);
|
addPhi(phi);
|
||||||
|
|
||||||
// Prime the phi for each predecessor, so input(x) comes from
|
// Prime the phi for each predecessor, so input(x) comes from
|
||||||
|
|
Загрузка…
Ссылка в новой задаче