Bug 1562298 - Check OOM after PerHandlerParser::finishLexicalScope. r=jorendorff
authorTooru Fujisawa <arai_a@mac.com>
Fri, 26 Jul 2019 21:17:54 +0000
changeset 485143 b9da377f23c12603ce45bbaf0cb8489d80059d39
parent 485142 8954a9b7f48676319f011a7471893458fc6a4338
child 485144 6b01f6dc63ca663e6dfc98f841342fd8e1858c66
push id91140
push userarai_a@mac.com
push dateMon, 29 Jul 2019 14:20:28 +0000
treeherderautoland@b9da377f23c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1562298
milestone70.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 1562298 - Check OOM after PerHandlerParser::finishLexicalScope. r=jorendorff Differential Revision: https://phabricator.services.mozilla.com/D36695
js/src/frontend/Parser.cpp
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -6994,16 +6994,19 @@ bool GeneralParser<ParseHandler, Unit>::
     ClassMethodType method = handler_.newClassMethodDefinition(
         constructorNameNode, synthesizedCtor, AccessorType::None,
         /* isStatic = */ false);
     if (!method) {
       return false;
     }
     LexicalScopeNodeType scope =
         finishLexicalScope(dotInitializersScope, method);
+    if (!scope) {
+      return false;
+    }
     if (!handler_.addClassMemberDefinition(classMembers, scope)) {
       return false;
     }
   }
 
   if (FunctionBox* ctorbox = classStmt.constructorBox) {
     // Amend the toStringEnd offset for the constructor now that we've
     // finished parsing the class.