diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 6fb5cf66361d..0a554ff0d077 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -2824,7 +2824,10 @@ IonBuilder::createBreakCatchBlock(DeferredEdge* edge, jsbytecode* pc) // Finish up remaining breaks. while (edge) { - edge->block->end(MGoto::New(alloc(), successor)); + MGoto* brk = MGoto::New(alloc().fallible(), successor); + if (!brk) + return nullptr; + edge->block->end(brk); if (!successor->addPredecessor(alloc(), edge->block)) return nullptr; edge = edge->next; diff --git a/js/src/jit/MIR.cpp b/js/src/jit/MIR.cpp index cd3cea8160b1..d3ad39a98321 100644 --- a/js/src/jit/MIR.cpp +++ b/js/src/jit/MIR.cpp @@ -2084,6 +2084,13 @@ MGoto::New(TempAllocator& alloc, MBasicBlock* target) return new(alloc) MGoto(target); } +MGoto* +MGoto::New(TempAllocator::Fallible alloc, MBasicBlock* target) +{ + MOZ_ASSERT(target); + return new(alloc) MGoto(target); +} + MGoto* MGoto::NewAsm(TempAllocator& alloc) { diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h index eb7bd6f2f254..396b0450b7b6 100644 --- a/js/src/jit/MIR.h +++ b/js/src/jit/MIR.h @@ -2913,6 +2913,7 @@ class MGoto public: INSTRUCTION_HEADER(Goto) static MGoto* New(TempAllocator& alloc, MBasicBlock* target); + static MGoto* New(TempAllocator::Fallible alloc, MBasicBlock* target); // Factory for asm, which may patch the target later. static MGoto* NewAsm(TempAllocator& alloc);