Bug 1035287, part 1 - Add missing oom check. r=jimb.
authorJason Orendorff <jorendorff@mozilla.com>
Tue, 08 Jul 2014 19:32:06 -0500
changeset 217115 b5b6b138a9009151f0078f537892f607be12f081
parent 217114 b50f9736768211dad53a558102858eb80053d147
child 217116 4515815020907e84660259ea993287bd84058855
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimb
bugs1035287
milestone33.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 1035287, part 1 - Add missing oom check. r=jimb.
js/src/frontend/BytecodeCompiler.cpp
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -181,16 +181,18 @@ frontend::CreateScriptSourceObject(Exclu
     if (!ss)
         return nullptr;
     ScriptSourceHolder ssHolder(ss);
 
     if (!ss->initFromOptions(cx, options))
         return nullptr;
 
     RootedScriptSource sso(cx, ScriptSourceObject::create(cx, ss));
+    if (!sso)
+        return nullptr;
 
     // Off-thread compilations do all their GC heap allocation, including the
     // SSO, in a temporary compartment. Hence, for the SSO to refer to the
     // gc-heap-allocated values in |options|, it would need cross-compartment
     // wrappers from the temporary compartment to the real compartment --- which
     // would then be inappropriate once we merged the temporary and real
     // compartments.
     //