Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1422)

Unified Diff: src/parsing/parser.cc

Issue 2135503002: Narrowly address async function stack overflow parsing case (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/regress/regress-624300.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index d74b36604f8b6acf7a2d9adf25178f4c5156712f..8bf1cbd7f05eb7e8a1f3a006658df99f06e1815e 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -1098,8 +1098,14 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info,
bool is_async = allow_harmony_async_await() && shared_info->is_async();
if (is_async) {
DCHECK(!scanner()->HasAnyLineTerminatorAfterNext());
- Consume(Token::ASYNC);
- DCHECK(peek_any_identifier() || peek() == Token::LPAREN);
+ if (!Check(Token::ASYNC)) {
+ CHECK(stack_overflow());
+ return nullptr;
+ }
+ if (!(peek_any_identifier() || peek() == Token::LPAREN)) {
+ CHECK(stack_overflow());
+ return nullptr;
+ }
}
// TODO(adamk): We should construct this scope from the ScopeInfo.
« no previous file with comments | « no previous file | test/mjsunit/harmony/regress/regress-624300.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698