Bug 1231224 part 3 - Fix some append() calls in Odin to handle OOM. r=bbouvier
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 10 Dec 2015 13:22:14 -0500
changeset 310256 fe63a5b34d53eb3adf3f2fe28e3090a4a8ec9c00
parent 310255 a80b9fd6fd19262905118d3d3d839f7d2c499b45
child 310257 96873f172d313bf2b742a50cf16998c52149f426
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1231224
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1231224 part 3 - Fix some append() calls in Odin to handle OOM. r=bbouvier
js/src/asmjs/WasmIonCompile.cpp
--- a/js/src/asmjs/WasmIonCompile.cpp
+++ b/js/src/asmjs/WasmIonCompile.cpp
@@ -99,17 +99,18 @@ class FunctionCompiler
             return false;
 
         for (ABIArgIter<LifoSig::ArgVector> i(args); !i.done(); i++) {
             MAsmJSParameter* ins = MAsmJSParameter::New(alloc(), *i, i.mirType());
             curBlock_->add(ins);
             curBlock_->initSlot(info().localSlot(i.index()), ins);
             if (!mirGen_.ensureBallast())
                 return false;
-            localTypes_.append(args[i.index()]);
+            if (!localTypes_.append(args[i.index()]))
+                return false;
         }
 
         for (unsigned i = 0; i < func_.numVarInits(); i++) {
             Val v = func_.varInit(i);
             MInstruction* ins = nullptr;
             switch (v.type()) {
               case ValType::I32:
                 ins = MConstant::NewAsmJS(alloc(), Int32Value(v.i32()), MIRType_Int32);
@@ -129,17 +130,18 @@ class FunctionCompiler
                 ins = MSimdConstant::New(alloc(), SimdConstant::CreateX4(v.f32x4()), MIRType_Float32x4);
                 break;
             }
 
             curBlock_->add(ins);
             curBlock_->initSlot(info().localSlot(firstVarSlot + i), ins);
             if (!mirGen_.ensureBallast())
                 return false;
-            localTypes_.append(v.type());
+            if (!localTypes_.append(v.type()))
+                return false;
         }
 
         return true;
     }
 
     void checkPostconditions()
     {
         MOZ_ASSERT(loopStack_.empty());