Bug 1425826 - prevent null pointer dereference in BinASTParser::parseBlockStatementAux. r=jorendorff
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Thu, 21 Dec 2017 10:57:55 +0200
changeset 397132 4d07f50ba637177239af481eac9202d5e15a13eb
parent 397131 c9fceb1a76ec9b85dd4aeb6be1ea61e04b421ec8
child 397133 1ca3a3798417706fcc0eeb3ca3070bc572626c64
push id33127
push useraiakab@mozilla.com
push dateThu, 21 Dec 2017 22:17:05 +0000
treeherdermozilla-central@d20967c26da5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1425826
milestone59.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 1425826 - prevent null pointer dereference in BinASTParser::parseBlockStatementAux. r=jorendorff MozReview-Commit-ID: FMIfHez97Yd
js/src/frontend/BinSource.cpp
--- a/js/src/frontend/BinSource.cpp
+++ b/js/src/frontend/BinSource.cpp
@@ -330,17 +330,17 @@ BinASTParser::parseBlockStatementAux(con
             break;
           default:
             return raiseInvalidField("BlockStatement", field);
         }
     }
 
     // In case of absent optional fields, inject default values.
     if (!body)
-        body = factory_.newStatementList(tokenizer_->pos());
+        TRY_VAR(body, factory_.newStatementList(tokenizer_->pos()));
 
     MOZ_TRY_VAR(body, appendDirectivesToBody(body, directives));
 
     ParseNode* result;
     if (kind == BinKind::Program) {
         result = body;
     } else {
         TRY_DECL(bindings, NewLexicalScopeData(cx_, scope, alloc_, parseContext_));