Bug 1425826 - prevent null pointer dereference in BinASTParser::parseBlockStatementAux. r?jorendorff
MozReview-Commit-ID: FMIfHez97Yd
--- 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_));