Bug 1491353 - Make the allocator fallible to work-around false positive uncatchable OOMs. r=mgaudet
authorNicolas B. Pierron <nicolas.b.pierron@nbp.name>
Wed, 19 Sep 2018 18:34:24 +0200
changeset 487523 dce559a7ac350c38dc03c3fbe3b2b5eb91b45a06
parent 487522 7ce8b77ec351be14e0fa8b499c17b2135f3627a8
child 487524 ddaebd2a173a54e61f6a641fd8080bed492a1324
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersmgaudet
bugs1491353
milestone64.0a1
Bug 1491353 - Make the allocator fallible to work-around false positive uncatchable OOMs. r=mgaudet
js/src/jit/IonBuilder.cpp
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -7264,16 +7264,17 @@ IonBuilder::newPendingLoopHeader(MBasicB
             }
 
             if (existingType.isSingletonUnchecked()) {
                 checkNurseryObject(existingType.singleton());
             }
 
             // Extract typeset from value.
             LifoAlloc* lifoAlloc = alloc().lifoAlloc();
+            LifoAlloc::AutoFallibleScope fallibleAllocator(lifoAlloc);
             TemporaryTypeSet* typeSet =
                 lifoAlloc->new_<TemporaryTypeSet>(lifoAlloc, existingType);
             if (!typeSet) {
                 return abort(AbortReason::Alloc);
             }
             MIRType type = typeSet->getKnownMIRType();
             if (!phi->addBackedgeType(alloc(), type, typeSet)) {
                 return abort(AbortReason::Alloc);